10 foot pole.......
Aint nobody got time for dat....
I kinda feel the same way... but here goes.
Short answer: Yes you can. It does not matter what the magazine is used in, only what it was designed for. A magazine designed to be used in a Semi-automatic Rimfire "long-gun" has no limits to the number of cartridges it may contain. A magazine designed to be used in a Handgun is limited to 10 rounds of the cartridge it was designed to hold. It dies not matter what firearm you use any magazine in, as long as the magazine is limited to no more than it's intended maximum capacity.
Case examples;
You buy a 9mm semi-automatic carbine rifle. The magazines that are included in the package are intended to fit this rifle and therefore must be limited to 5 rounds. However, this rifle uses Glock/Beretta/1911 magazines, and can therefore use any magazine in that family. Because these are pistol magazines, they can legally hold 10 rounds. Now, these same pattern magazines also come in .40 S&W, and therefore 10rd. .40 S&W Magazines can be purchased for these pistols. Some of these .40 S&W magazines will hold 14 rounds of 9mm. You can use these magazines in both your rifle and your pistol because the magazine was designed to be used in a pistol and designed to hold 10 rounds of .40. It does not matter what firearm the magazine is used in or how many rounds fit into the magazine as long as you do not exceed the capacity limit based both on Cartridge and Action-type. This also why you can fit 18 rounds of .223 into a 5 round .50 Beowulf magazine. Also, manual action and rimfire long-guns have no magazine capacity. Therefore, a magazine designed to be used in a manual-action or rimfire long-gun can be used in a semi-automatic rifle, and could potentially have an unlimited capacity. This is why we can use 10rd. AIA Enfield magazines in our M1A/M305/M14S rifles.
So to sum all that up. Magazine capacity is determined by two things, first and foremost what type of action is being used (Manual, Semi-auto or Handgun) and secondly by the cartridge the magazine was designed to contain. You can use any magazine in any firearm provided it does not exceed the capacity limits of it's design.
Clear as mud?