It sounds like both the light and fan are connected to the same wire. And yes, it's a bad idea to put a fan on a intended-for-lights dimmer. It's not likely to cause problems per se, but it'll make your fan hum. If you pull down the ceiling fan, you'll notice two black wires and one white wire. One of the black wires goes to the fan, the other goes to the light, and they both share the white wire. At the switch, you'll find (most likely) a black wire going into one side of the switch and a second black wire going out of the switch up towards the fan. You have a couple options:
1) Run a new Romex cable from your switch to the fan. At the fan end, connect the fan's black wire to the new (romex) black wire and the new (romex) white wire to the existing white wires. At the switch end, connect the new black wire to the black wire which feeds into the switch, and connect the white wire to the existing white wires behind the switch. Leave the light's black wire connected to the existing black wire that comes from the switch. This will result in the light being on a switch (which you can then swap out for a dimmer), and the fan being always powered, so you control it with the pull chain. It sounds complicated, but it's really not--basically, you're running separate wiring for the fan which bypasses the switch.
2) Buy a new ceiling fan which can run off a light dimmer (some are designed to work this way)
3) Get a night light and/or a touch-activated lamp and forget the wiring.