Note: This is distinct from the concept of a military imposter.
Regardless of actual instances, it's important to realize this is a really old trope, one which the shows you mention adopt but did not invent; MASH also has a very similar story line (Season 10, Episode 2). And well before that, there was the strange case of Martin Guerre, which recently featured in this thread.
The persistence of this theme in the modern consciousness is intriguing.
In Mad Men it was the Korean Conflict. The Vietnam war is discussed much later on in the show. Would you apply the question to both wars?
It probably is something that has happened often. The Soviet Republic of Georgia used to be famous for the large number of men over 100 years old who lived there. Perhaps not coincidentally, this could be explained by the hypothesis that, during WWI, a significant number of men had gained a large number of years of age and avoided the draft by assuming the identity of their deceased brothers, uncles and fathers.