Change icon on state change of other entity

yes it is, but you asked if you can do that.
actually, I was wrong. If you want to change icon, use template_sensor - it has icon_template