I think it's the opposite actually. Exposure to other races leads to racial tensions, but it also builds tolerance as well. The most homogeneous countries are likely the most racist due to lack of exposure, but because they have fewer minorities, there's usually little racial tension to expose, and people can always give the impression of being tolerant even if they aren't that way inside.
One of the most racist countries is China. Han Chinese systematically dominate and often ethnically cleanse minorities, like in Tibet and with the Uighurs. Hans themselves are about 90% of China's population, and that percentage is likely to rise over time due to ethnic cleansing.
I think you are right but so am I. What you suggest doesn't happen immediately. In the beginning there is friction,
As for homogeneous countries, do they typically have a lot of racism within? How can there be racism in a country where there is only one race? You are referring to their attitudes towards outsiders, and I would tend to agree - but have a hard time explaining the likes of Norway (on that last count).
Maybe prejudice is a better expression of what I mean. Norwegians overall probably aren't very racist in their behavior, but they likely have a good amount of prejudice. Scandinavia overall has accepted an exceptionally high amount of refugees in the last 20 years when compared to the size of their native populations. Sweden actually let in more refugees in total than any other EU nations for a few consecutive years when the Syrian War was at its worst point. Of course, most of the refugees that came to Sweden were actually from Afghanistan.
I think Scandinavia overall can be best seen as having cultures that are socially very far left. They take progressivism much further than we do, and that leads to actions that, on the surface, seem very tolerant. However, it would be difficult for Norwegians not to have a certain amount of prejudice towards refugees due to differences in their behavior. Scandinavians overall will often deny this, but there is a sexual assault and rape problem among the migrants/refugees, for example. They also put the refugees in large tenements, which leads to conflicts sometimes, since multiple ethnic groups from Afghanistan and Syria will live in these buildings. These groups will often have scores to settle relating to conflicts that happened back in their home countries. The repercussions of these conflicts have led to grenade "incidents" in places like Sweden. That undoubtedly gives a bad impression.
And of course, when you separate refugees into their own sections of town, that allows you to compartmentalize your "tolerance." It's a lot easier to tolerate a poor minority if they live on the other side of town, as opposed to them being in your own neighborhood. As much as parts of America are still segregated, we're actually much more integrated than most of Scandinavia. So, tolerance can sometimes be somewhat superficial.