That's an idiom indeed. You say that to tell someone they're welcome to drop in on you.
The etymology... Well, there was a custom way back in the day to put a burning candle on a window ledge. That was indicative of someone being at home, hence забегай на огонёк as an invitation to drop by.