Do dimmer switches work properly with any kind of lamp?
Short answer, you need special CFL or LED bulbs to work with dimmers. Some will work with standard incandescent dimmers, some need specific CFL or LED dimmers.

The reason for this is that a standard incandescent bulb works off direct (AC) voltage. A lamp or lighting fixture is directly connected to the wiring in your home, and that's it. Nothing but metal and the filament in the bulb. A dimmer basically cuts the voltage in half (or a certain percentage depending on how much you are dimming) by resistance or by a solid state relay cutting the voltage on/off as needed (PWM, averaging the on/off periods), but the bulb still works by the filament heating up as normal, just less brightly. Filament incandescent bulbs are DUMB.

LED and CFLs on the other hand, have control electronics in them. They are SMART. Not just resistors, but rectifying the AC voltage, stepping it up/down, current control, ballast, etc. The ones that arn't designed for dimmers have a very very small input range (110~120 AC ± a few volts) that the electronics inside are designed for. Fall out of that range, and it won't work, and can cause damage. New and specialty ones take customer needs in mind, and fix or improve or add features that make the electronics work with a dimmer, with either resisted or pwmed dimmers.

Not all LED/CFL bulbs will work with your specific dimmer, but there is a good chance that ones marketed as Dimmable, will work.