Oh yeah, if there were street lights on the moon, we could detect them, no problem. You can see the streetlights of Earth from orbit, and I'm pretty sure you could see them from the moon as well with a telescope.
You can't resolve individual streetlights of course, but the overall light output of a major city is no problem. And certain lines aren't likely to be naturally there, like sodium lines, they're much hotter than the surface of the moon, so you can easily spot them with a spectrogram.
I don't see any theoretical reason you couldn't do that on an exo-planet, you'd have to mask out the light of the star though.