Depends...
...some firearms (especially older models) are not set up to take dry firing. My CZ-52 for instance has a very brittle firing pin. I know of one gentleman that intended to replace the original so he did a test and busted the original pin with less than 20 dry fires. There are some good threads on dry fire that you can find with a search.
The conventional wisdom is that modern centerfire weapons are safe to dry fire. As an added measure of safety, and to provide a physical reference object as part of my dry fire practice, I use snap caps. I've had good luck with A-zoom (widely available at places like Midway USA, Cheaperthandirt.com, etc.).
I've found dry fire practice to be an essential part of my training. I think you'll find most serious autoloader practictioners incorporate dry fire sessions into their regimen on a regular basis.
A critical element to dry fire practice is remembering that the 4 RULES still apply! Never point the muzzle at anything you are unwilling to destroy, even during dry fire. Your dry fire practice area should involve pointing at an object that would stop a live round. I practice in my basement.
Most folks will tell you to avoid even being in the same room where ammo' is kept during dry fire sessions. Given my space limitations, I clear the weapon, lock every live round up during dry fire as part of the routine. Another piece of good advice that was given me is to make sure that when you stop, you stop!! Don't stop your practice...then decide to go back to it for just one more set of draws, reloads, DA trigger presses, SA trigger presses, safe reholster, etc. When you've had enough, stop...it's safer that way.
Of particular benefit is the opportunity to practice in dry fire, activities that may be prohibited at some indoor ranges. Many prohibit rapid reloads, draw from holster, etc. Dry fire lets you work on those gun handling techniques with an added measure of safety prior to attempting them live fire at a location which permits them. I started competing in IDPA this year after about 2 years of restricted bench shooting...the bench shooting was essential to shot placement, but dry fire let me prepare for many of the gunhandling activities that IDPA requires that the ranges I shot at forbid.
Good luck &
Safe shooting,
CZ52'