I would say that if you enter someone's house and they have finished floors (carpet, hardwood, stone, etc) you should take your shoes off or at least have the courtesy to ask. If the house you're visiting has dirt floors, you probably don't have to take your shoes off.
As someone who has hardwood floors, I don't ask for people to take their shoes off when we have a party, unless they are really dirty (rain, snow, sleet, mud, etc) but our area rugs have still been ruined by this. It's an unfortunate by-product of hosting parties - floors will get dirty, things will spill and dishes/glasses will break. You don't know your guest's tendencies so just expect things for the worse and be careful who you give a glass glass or breakable dish or allow into certain rooms of your home.
Unfortunately, I like to sit on my own floor and play with our toddler who likes to crawl on our floor so I'd rather have the floors clean than having dirt tracked through the house by street shoes so I tend to take my shoes off.
Sometimes I think of Robert Morse's character on Mad Men, Bertram Cooper; who requests that every person who enters his office takes their shoes off so as to not ruin his carpet. In the second to the last episode last year, his sister visited and didn't take her shoes off and he responded with something like, "Dammit Alice, I don't ask much of you" to which she responds, "these stockings cost more than your carpeting."
"It's not that I'm on commission, it's just I've sifted through a lot of stuff and it's not worth filling up on the bland when the extraordinary is within equidistant tasting distance." - David Lebovitz