You can replace a switch for any incandescent light with a dimmer. Fans and fluorescent lights use special dimmers.
You can replace one of the three-way switches in a circuit with a three-way dimmer.
A dimmer can control line-voltage halogen lights, but a dimmer won't work with low-voltage halogens.
About 20 minutes to replace an on-off switch with a dimmer
Screwdriver, side cutters, voltage tester, lineman's pliers, strippers
Stripping and splicing wire
Lay a towel or small drop cloth on the surface below the switch.
Dimmer switch, wire for pigtails, wire nuts (they may come with the switch), electrician's tape
On a one-switch circuit, if the dimmer is the only switch controlling the light, the dimmer has one green and two black wires or a green, a black, and a red. Connect the green wire to a pigtail that grounds the box and to the green or bare wire entering the box. If both wires are black, connect each to one of the remaining unconnected wires. If the wires are red and black, check the directions for the dimmer switch. One needs to connect to the hot wire, the other to the light.
If the dimmer and a three-way switch control the circuit, the dimmer has a common wire that is most likely black. The two travelers are the same color as each other, usually red. If there's any confusion check the directions that come with the dimmer. Then check to see which wire in the switch box is hot. Connect the hot wire to the common wire. Connect the ground to ground and connect the remaining two dimmer wires to the remaining unconnected wires.