If it’s a centerfire with hammer, generally won’t hurt the firearm. If it uses a firing pin (.380 semi, etc), don’t do it. You can damage the firing pin.
What used to happen with older weapons was that the firing pin would eventually elongate and could end up going through primers. Again it won’t happen with decent modern weapons.