It depends on the generator
and what kind of engine
Mine has a three cylinder Yanmar
which was designed for small tractors, so it is capable of dealing with a certain amount of heeling.
I generally avoid running mine underway, but if the sea is reasonably calm and we're on a broad reach, say, with little heel, I'll fire it up if it's needed.
I reckon it's probably not that dangerous since, unlike your main engine
, they have oil pressure cutoff switches which will kill the engine if there's a problem with oil pressure.
But I wouldn't do it with any significant heel, just like you wouldn't do with your main engine.