If we take "social class" to mean income/wealth as it's most commonly the case in the West today, then there's even an academic term for the uncommon friendships across such classes, namely "income-bridging". As for their occurence, let me quote you from a paper by Léna Pellandini-Simányi (which happens to survey Hungarian society, but I think it easily generalizable across the Western world):
Many of the income-bridging friendships are between former classmates whose class position diverged, yet who kept their old friendship alive.
Finally, letLet me tell you from personal experience that this is 100% the case for me, if we take the "income-bridging" to mean a tenfold difference in income.
Also from the same paper on Hungary, this interesting bit regarding the socialist past:
During socialism, status-bridging friendships were not more frequent in Hungary than in capitalist societies, contrary to the image of an egalitarian and open society promoted by political public discourse. [... However] It is important to note that these [socialist-era] studies measured class by education and working position, omitting income.
The last part kinda reminds me of joke/advice along the lines of: don't get a PhD to impress your friends, once you get a PhD most of your friends will have one.