Why where eastern countries like the USSR, Yugoslavia and Czechoslovakia rife with deportations and ethnic clensing post war, but not western europe?
That's... complicated.
See, by 1939, the worst of the ethnic troubles in Western Europe had pretty much been sorted out. You a Frenchman, a German, a Belgian, a Dutchman or an Italian. The Napoleonic Wars, the Hundred Years War, etc... pretty much ironed out the lines between states and nations, but it was by no means pretty, clean or easy. The Enlightenment, the post-French Revolution waves of Nationalism, etc... had pretty much hit everywhere in Western Europe, solidifying the concept of the nation-state in those countries. People stopped being Normans, Aquitanians, Bretons (
no, not a typo), or Gasconians; they were now French. Some kept their cultures and identities, and even languages, but for the most part, they went along with the new system.
Eastern Europe, however, is a much more mixed bag - and I do mean mixed. See, up until 1900, Eastern Europe was under the control of like three or four massive powers; Ottoman Empire, Austrian/Austro-Hungarian Empire, German Empire, and Russian Empire (as is pretty well-known here on AH.com). These guys were a lot better at suppressing nationalist sentiment for a long time, and unlike the West didn't make it a habit of absorbing lesser minorities into this idea of a nation state and national identity. If you were French, then you were French. If you were Austro-Hungarian, then that meant you were a subject of the Austro-Hungarian monarch, regardless of ethnicity. The "old empires" fought hard to squash any ideals taken from the French Revolution, as the idea of nationalism spreading to Eastern Europe meant the much more fractious ethnic groups would be at each other's throats in a second. And yet by 1918 it was all moot, as these new nations were given their freedom and their countries.
What complicated matters was how these empires allowed for freedom of travel within their borders. Russians, Czechs and Germans moved into Polish lands during the long Partitions of Poland, Romanians were allowed into the Carpathians, Serbs/Croats/Slovenes were allowed into historically Italian lands under Austrian rule. What this meant was there were now massively mixed populations, making partitioning lands along ethno-nationalist lines incredibly difficult. The Hungarians found their country reduced to a third or a quarter its former size as territory was given to the Czechs, Slovaks, Serbs, Romanians, and what have you because of the now-sizable ethnic groups forming the majority of the population there - and occasionally acts of petty revenge by the victorious Entente.
By 1939, the issues had not been sorted out, so Hitler made plenty of ammunition in using German claims with large sections of German people trapped in foreign lands. It didn't help that Poland (and other nations) engaged in Polandization programs that forced the populace to conform to the Polish (or what have you) majority. When WW2 ended, the USSR, Poland, and Czechoslovakia went "Right, we're not going to have Germany stir any more shit in future, so any Germans still in our lands are getting the boot and leaving
NOW." Yugoslavia did the same with the Italians in their territories, and Tito quashed the ethnic issues and the assorted atrocities under show trials and pretending that everything was hunky-dory now*. In the process, any other 'undesired' ethnic groups were told to be obedient or GTFO, mostly to tie up any loose ends. There were no mass slaughters like what the Germans did, of course, it was just forced evictions and confiscations.
An example of this pre-WW2 was the Turkish War of Independence. Anatolia may have been Turkified over the centuries, but the coastline remained largely Greek even under centuries of Ottoman rule. When the Entente gave the Greeks all their historic territory, and they proceeded to kill or evict as many Turks as possible. Ataturk revolted against the weak and useless Sultan, rallied his forces, and turned the tide, forcing the Greeks off the mainland, and forcing the Greeks to evict their remaining Greek population from what is now the western Turkish coastline. Greece still held the islands, but the Turks made sure that what they now held was Turkified - including the newly rechristened Istanbul, just to remove any trace of its former Greek heritage.
* - and in case you missed it, no, burying everything under a level of denial merely postponed the issue, didn't solve it. Ten years after Tito died, Yugoslavia exploded in a mess of ethnic hatred and racial violence.
EDIT: Just to clarify a mistake, I realize the German Empire wasn't formed until 1871, but up until the Napoleonic Wars it was under the domain of the ailing Holy Roman Empire and generally was a Germanic entity throughout. Yes, the myriad states in it had a bit of freedom, but overall, the HRE was an entity holding Central Europe together by a throne rather than by ethnicity, though it did help that a large part of its territories were German ethnic.
Hell, just by looking at this map, it's easy to see where the 1871 German borders stand in comparison to the HRE of 1789 (at the cusp of the French Revolution)
https://en.wikipedia.org/wiki/File:Map_of_the_Holy_Roman_Empire,_1789_en.png