Stereotyping is a kind of "natural" thing for a vast number of Japanese, especially the older generations; which I just engaged in by putting the mark on the older generation(s). But it is the truth.
For example, the folks from the Osaka area that had in the past engaged in the beef/pork industry have for years been labeled here in the Kanto area as sort of different, and I am trying to be polite with that way of expressing it.
The Ainu folks from up north, like Hokkaido, are/were really given a nasty time by a whole bunch of the older folks.
And, yes, the folks from the rest of the planet are considered like not so cool here. And that is, again, trying to put it politely.
Now, for me, I used to live in the ROK and ended up here in Japan permanently sort of by accident. And it was also my recognition of having fallen into a racist way of thinking for a second time in my life that also had me stay here longer than planned and then ending up here for - - - well, I'll die here. That will likely be within a year or so, as this cancer will eventually beat the doctor folks that have done good work keeping me on my feet for this long.
Anyway, back to that "older generation" thing. Many younger folks that have set their minds to opening up to the rest of the planet have somewhat dropped a lot of that "Japanese are super special" style of thought and are less racist; maybe some not at all racist. But the younger folks that have fallen under the strong influence of older folks and have picked up that "Japanese are super special" style of thinking are in a bit of a mental prison, which is what racism is, a mental prison that is hard to escape from. And some stay in that mental prison forever.
Now the thing about being a foreigner here is that one has to right away realize that there ain't no way they are EVER going to be looked upon as some sort of equal to the natives in this country, so STOP trying! It is just that simple. Know you are looked upon differently and live with it. Cherish it. Use it to your advantage. It really can be used to your advantage, if you are clever.
By the way, I left out above that there is also a very serious "getting along" problem between the Japanese and the Korean folks, and that includes the generations of Koreans that ARE Japanese citizens and have been for a very long time.
By the way, another thing that is seriously helpful, if you are a gaijin here, is if you work for an organization that is connected with the Japanese government or a highly placed commercial company. I got very lucky on that one, and it was a sort of luck thing. In fact, later in my years here I actually worked at gaimusho for a couple years, which is very unusual for a foreigner to get to do. But you sure better understand the Japanese government worker's way of viewing themselves or you ain't gonna make it. I was put into gaimusho due to a program Prime Minister Koizumi had going. But he used up his political clout getting the postal service sort of privatized and his next special idea didn't rotate. But that Koizumi aircraft sat on the active and blocked the runway for about a year. I, too, helped keep it on the active.
Oh yeah, you want to have a lot of "fun" here, get thrown in jail with the "bad" Japanese and it gets really interesting. My trouble was I got caught fighting. But it was only a couple weeks and the judge finally tossed the whole thing out. Funny thing, though, the police actually had to let me get back to work in my cell. My boss brought my work to the cell everyday after about the third day I was there. The other folks in that jail were mighty impressed by that and that helped keep me sort of safe. There is a serious pecking order in a Japanese jail, by the way. Foreigners are immediately at the very bottom. And stay there. And you immediately are aware of the top yakuza in the jail when the morning wake up takes place and you get to wash your face and brush your teeth. You best show respect right away to that top yakuza or you be in big trouble!!