No. Magazines for different types of handguns can vary in size, shape, and design. Some magazines are also specific to certain calibers of ammunition.
For example, most 9mm Luger magazines will not work in a .40 Smith & Wesson handgun because the chambering and dimensions are different between the two cartridges. However, there are some 9mm Luger magazines that will work in a .40 Smith & Wesson handgun, but they are rare.
It is important to check the compatibility of a magazine with a specific handgun before purchasing it, especially if the intention is to use the magazine for self-defense purposes.
Some gun manufacturers produce magazines that are compatible with multiple models of handguns. For example, GLOCK produces magazines that will work in all of their 9mm Luger and .40 Smith & Wesson pistols. These magazines are usually labeled as “universal” or “multi-fit.”