Where I was born in a European country, it was positively unthinkable. Nobody ever wore outside shoes inside. In fact, my grandma would be upset if I set in my daily jeans upon my bed - jeans that set in school seat, street car seat, benches, dirt, etc, should not be in contact with where I'll sleep.
In USA and Canada, it seems to largely be an instinct to say "Don't take off your shoes, please!" out of politeness.
I think there are other aspects too, though they get fuzzier.
In my country/childhood, kids were discouraged from playing on the floor in unfamiliar places. I observe less of that in Canada. Most dogs were "outdoor animals", whereas here dogs are pervasively inside. Many people sleep with dogs in their bed!! Completely crazy to me and completely normal to my Canadian wife :-)