You are correct about the Glock magazines. Regarding your second question; it depends on the type on model and caliber usually.
For example- Any 1911 magazine whether it's 7 or 8+ rounds will generally work in any 1911 as long as they're the same caliber. Glock magazines as long as they're the same caliber will work in any of the glocks like you said. Usually if you have a compact or smaller version of a firearm the larger magazine for that bigger firearm will work in the smaller one.
Did that help?
"It's a gun you loaded on Sunday, and shot all week."
"If God didn't create man equal then Sam Colt had made them equal."
"Fast is fine, but accuracy is everything."