Can the dome gunner on a B-17 Flying Fortress shoot the plane's tail off?
There's a profile cam in the turret track ring that operates a mechanism that interrupts the guns when the barrels are pointed at parts of the aircraft.  Waist gunners were the only ones who had to worry about hitting their own plane.

The bigger problem was gunners hitting adjacent aircraft.  The "box" formation design attempted to provide as much of an open field as possible to each gunner.