Ah yes, the opportunistic petty thieves. Overall, I would say that petty theft (particularly from foreigners) has a level of cultural acceptance in many places. Certainly in parts of, or most of, Latin America.
Sometimes it's not viewed as theft, at least culturally. In Polynesia, there exists a cultural concept of communal property. It's a constant problem for some, as if your brother needs a chainsaw and you have one he'll just come and take it. There is no real "bring it back when you're done" you have to first figure out who has your chainsaw, and then go get it. Same goes for food- if your cousin is hungry and you're not home, he just helps himself. This is not theft.
It's worse in Melanesia because what we might call theft or even graft is culturally enforced. Typically, an extended family might have one working professional. If a brother or cousin asks for money, they have to give them money! If the money earner is sitting at the pub, a family member can "demand" that he buy him a few beers too. This is very strongly culturally enforced, despite being a huge divide between Melanesian and western culture. The "victims" shrug their shoulders and say there's nothing they can do but fork over the money or goods- the only way to avoid it is to physically avoid certain family members...they would NEVER EVER dare to refuse even the worst family members.
In Solomon Islands, a bunch of American Habitat for Humanity guys arrived to build houses. Free, of course. Like any good people who had been culturally briefed, they knew you NEVER wear shoes into a house. So after their first day at work building a house for the community, they returned to the guest house and removed their work boots, leaving them on the porch. The next morning all of their boots were gone. In a similar conundrum, you cannot wear shoes inside the Hagia Sofia mosque in Istanbul...but if you put them in the rack outside, they're likely to be stolen.
In a large part of the world, if an item is unattended it's fair game.
The next level up is threats and demands. For example, claiming to be the chief and demanding that the foreigner pay money for being on his land. This is so common it's laughable. The real problem is that the pansies pay up, creating a problem for everyone else.
One cannot avoid being a tourist, per se. It's not uncommon that I've been the only white guy for 200 miles- it's pretty hard to hide that I'm Palagi. I prefer foreigner over tourist, because that is what one is- foreign. As such, opportunists and criminals have a head start because they've readily identified someone who might be an easy target. But what they're really hoping for is a fool, a pushover. Being a foreigner doesn't mean one has to be a victim, but some are just inclined to be that way.
In most of the world, although petty crime is rampant, violent crime is not. This is particularly true for rural areas, just like USA. The people are friendly and kind. If the foreigner is also kind, and expresses interest in the locals and their culture, it opens a whole new world of opportunities. People will come out in droves to be your guide, to find things you need, to bring you food. And over time, once integrated into these societies you can leave your boots outside at night.