As long as you don't use conductive epoxy, like JB weld.
Extension cords have neon-lamps molded inside them as indicators and works fine.
Instead, I use an LED and a resistor+shunt diode, as some chinese neon lamps they push them hard for brightness and they don't last that long. Flicker flicker.