There was a lot more variation during WW2: Stens and MP38/MP40s had 32 round magazines, didn't they? BARs and FG42s had 20, Brens had 30, PPSh stick magazines had 35, M1 carbines had 15 round mags, but 30-round mags were introduced with the select-fire M2s. The MP44 had 30, the Thompson had 20 or 30 round magazines.
Not even the 30 round 5.56mm magazines are completely universal. The HK G33/G53 come with 25, 30, or 40 round magazines. The FAMAS F1 used by the French Army has 25 round magazines, and the Steyr AUG has 42 round magazines available. However, the later FAMAS G2 (French Navy/Marines) and HK G41 take STANAG magazines, so typically take the usual 20 or 30 rounders that ARs do.