Most departments won't let officers moonlight for certain businesses, alcohol is one, casinos/gaming is another, tow truck operators or repossession agents are another. I should say, every department who's manual I have personally read bans those kinds of industries. I can't speak for the ones I have not read in person.
I think too part of it depends how and where they're moonlighting. An example is the puyallup fair here in Washington, the largest fair in the state, the fair is privately owned, but attracts literally tens of thousands if not hundreds of thousands of patrons yearly, people come in for agriculture shows from all over the PNW, there a rodeo. Big name acts like Taylor Swift, Heart, this year Toby Keith and REO speed wagon are coming, this is huge event, and there are dozens of police officers wearing uniforms from agencies all over the state at the fair everywhere. I think the fair is paying their salaries and they're expected to work as police officers, I think immunity might cover them then... I really don't know. They make arrests and act like cops at the fair, not like security, so I would assume so.