Online I think, its just part of the game, that people can leave, whenever they want, and for whatever reason. Also why does it even matter? Online there are always other tables running and other people playing, so players being "stuck" have plenty of chances to win their money back.
In live poker I would personally be hesitant to make a "hit-and-run", if I though, it would be ill received, and I might come back to play with them another time. I think, if you are a professional or semi-professional live player, you need to treat the weaker players in your game like your customers, and try to make them happy.
I can still see situations, where I might do it though. If for instance I am sitting with a big stack, and some wild maniac is deep stacked as well, that might force me to play outside my
bankroll and comfort zone, and I see no reason, why I should accept this. So in that situation I would just make some excuse, that my wife texted me, and our son is sick, so I have to go home.