Ammunition and Magazines (Ugh, FINE, CLIPS! Heathens.) were usually firearm specific, and have been for quite awhile. It's rare you can get companies or countries to agree on standardization when it comes to this, and usually there's a lot of fighting over it for some reason. (The only reason it happened at all, I bet, is due to the Cold War.).
I think idea is that it makes it more difficult for soldiers of an opposing force to use your own equipment against you as easily. Using captured weapons is usually not a good idea, especially if a weapon has a distinctive sound (The AK is infamous for it's sound, for example.), as soldiers can spray-and-pray towards a sound in the dark or through concealment (Jungle, interior walls, AR Spam, etc.). This is one of the reasons US Soldiers didn't use AKs during Vietnam when they first got their hands on the M-16, "The Rifle That Cleans Itself", and all the fun that entailed in that.
Assault Rifles have pretty much Standardized as NATO/Soviet styles. Pistols have kept the proprietary magazines/clips/punch-you-in-the-junk-terms somehow, don't ask me how. Politics, probably.