You can do this to the Ruger .22 pistols all you want and it won't hurt them. In fact, you have to dry fire them to take them apart for cleaning. You don't actually need the snap cap on the Rugers.
THIS IS IMPORTANT: Don't do it on any other brand of .22 rifle, pistol, or revolver. In almost all other makes, the firing pin will bang into the edge of the firing chamber and damage the chamber wall. It might also crack the firing pin on older guns.
You can safely do it to any modern centerfire handgun because the firing pin won't hit anything if the gun is not loaded. You shouldn't do it to older guns because the steel is brittle. The cartridge actually softens the impact of the hammer to the frame. Without the cartridge, or snap cap, it can damage the hammer and the frame.
You should not dry fire shotguns as the hammer strikes with significantly more force and can damage the locks. This is especially true of over/under guns and side by sides.
Ordinarily I would say Blast Away, but in this case I guess it should be Click Away!