It is only natural to be curious about why someone looks different and how that will affect you.
Where I'm from there's not a lot of black people (<<1%), so when I first saw a black kid in my primary I was curious and somewhat afraid (was only 6).
Not in the sense that they might harm me, but in the sense that I might behave somehow to offend them. Same thing happened when I had a blind fellow student. I was nervous around him fearing I might offend him somehow.
I think racist behavior can be reduced by travelling around the world, and witnessing how other people live, think and what opinions they have about foreigners or people with different attributes than the dominant percentage of the population.
Being a foreigner in the UK, I have been very rarely been discriminated, but reading the news about how certain groups of people want foreigners out, I understand why when it comes to people coming over and just getting benefits, cause that's my tax money as well, but to generalize all foreigner workers saddens me.
However, the same behavior can be observed to where I'm from. A "nationalist" party, whose supporters preach that foreigners should go back.
So my conclusion is that everywhere you go there's people that don't want foreigners, and are racist, but the people who are less racist are those who have a high standard of education, but most importantly have traveled.