It's the distance between the APU exhaust and the aircraft fuel tank vents that is critical.
On the A330 there is a vent in the horizontal stabilizer that is considered to be within the critical zone.
Anyway, it's good practice to not change power sources during refuelling. Glitches do happen.