Like, standing at the urinal, say in a public airport bathroom. Just as if you were taking a piss, but you decide to jerk it instead.
I mean, nobody should be looking at your dick anyway, right?
General public no, but air crews are certainly allowed. Wear a pilot hat and you will be fine.