I would also be thinking more along the lines of practicality/safety than etiquette, first. Standing on a chair to reach something, how would I feel safest? If I could go either way (shoes on or off) I would probably leave my shoes on unless they were crusted with mud or something--not because I think the socks are dirtier, but just because it's less work to leave my shoes on my feet. I've brushed numerous dusty footprints off chair seats in the past and it doesn't bother me.
In someone else's home I would ask them first, but with some underlying assumptions. Like, if my options are either climb on something in high heels or my bare feet, and my host thinks bare feet are gross... I'm not climbing up to do whatever. I'm not climbing in high heels, because I am clumsy. Safety first.