Can I hang a ceiling fan where a light is?

Yes, but first you must make sure the electrical box is properly braced and rated for the weight and torque of the ceiling fan you are installing.