To paraphrase Jon a bit, the DCC is a boon and a bane when converting from "analog DC".
Quite often the lamps in DC locos are 18v rated or so, which is fine, as the track voltage is varied to control the speed, and 18v volts is pretty rare, trains will usually run at way too high a speed.
Now, DCC has a constant voltage on the track, so now, the norm in G scale is 24v (this is to ensure all locos can hit top speed if necessary)... but it is 24v ALL THE TIME,
So your 18v bulbs will probably burn out if there is no accommodation for the constant higher voltage.
To make it a bit trickier, this is actually AC on the rails. Incandescent bulbs do not care (like the common light bulbs in your house), but LEDs want DC not AC, so usually you put a full wave bridge rectifier to lights connected to the rails on DCC. LEDs also need appropriate "current limiting resistors" to basically control the current so they do not burn out.
If you are using a decoder, then there are more accommodations for LEDs and the appropriate voltages/currents.
The bottom line is check the situation carefully before putting a lighted "DC" car on DCC power.
Greg