There are a few different types of handgun magazines, but most are not universal. The most common type of magazine is the box magazine, which is usually inserted into the grip of the gun.
There are also drum magazines, which hold more rounds than box magazines and are typically cylindrical. Pistol caliber magazines (9mm, .40 S&W, .357 SIG, etc.) are not interchangeable with rifle caliber magazines (5.56x45mm NATO, 7.62x39mm Russian, etc.), and vice versa. Some double-stack magazines (those that have a wider width) can be used in both single-stack and double-stack guns, but not all guns will accept every type of magazine.
It is important to check with the gun’s manufacturer to see which types of magazines are compatible with your particular model.