That is the beauty of the Glock design. Same caliber magazines from a higher capacity pistol will fit into and operate in the smaller capacity pistol. They simply stick out the bottom of the mag well farther than usual. For example, if you have a Glock 17 mag (9mm), it will fit in and work in the G17, the G19, and the G26. I would love to see the 33rd mag sticking out of the little G26!
One thing to check is if your glock has the over-insertion stop. If you look at the top of a magazine (rounds facing forwards), there is a rectangle jutting out on the rear of left side. With your glock field-stripped, gently insert one of the longer mags, and it should stop on a corresponding block in glock frame. If your frame lacks this block, you can over-insert a longer mag, resulting in damage to the ejector.
Glock 21 Mags work great in the Glock 30. 13 rounds of .45ACP fun.