Yeah, I think it has more to do with how you're taught to think about people than what you're exposed to.
I grew up in Spokane, WA -- 87% white by demographic survey, 98% people who look white if all you know about race is what you learned in Social Studies in elementary school. :) But what I was dominantly taught about who 'my people' were came from Christianity -- Christ died for everyone. My tribe is humanity. I was not raised to think race was important, and I didn't. That upbringing is with me to this day. I didn't reflexively categorize people by race, and I still don't. It's not something I even notice unless attention is called to it somehow.
Other people from the region were raised differently. The inland pacific northwest is a region that white supremacists like, and we had them.
Growing up in a racial monoculture, you could wind up totally innocent and clueless (like me) or totally racist (like some people I knew of), and probably a lot of other things. It really depended on what you were taught.
The same can happen in diverse cultures, too.
When I moved to Seattle, there was a lot more racial diversity. It still didn't mean anything to me, but it clearly meant things to others, and some people made quite a big deal out of it. I had an amusing conversation with a fellow visiting from the UK about it:
Him: So . . . what is *with* your black people?
Me: Excuse me?
Him: Well, back home, we have black people, too.
But . . . they're just regular people.
The racial diversity in Seattle and in the UK did not result in the same attitudes! Of course, there are other 'tribes' over on that side of the world that
do matter. But they aren't the same ones as matter over here.
All in all, I think it's not what you're exposed to. It's how you think about it. If you see race, or gender, or religion, or age, or profession, or interests, or lifestyle as what makes someone 'your people', you can't help but have loyalties and opinions about what it means to be in or out of that circle. It doesn't matter if you meet foreigners (by your definition) every day, or once or twice a lifetime.