Yes. Spray paint designed to adhere to metal or polymer will generally work on a gun, but will chip and fade fairly quickly, especially if you use it often. For the most part, even spray paint that is not designed for metal or polymer won’t hurt your gun, it just also won’t do much good.