Large airplanes are pressure refuelled so vapor escaping through the fuel port is not an issue as it is in smaller airplanes. You are correct, however, that the fuel/air mixture existing in the tank will be displaced by the incoming fuel. The wings will have vents installed that will allow the air mixture in the tank to escape (and fuel in the case of over fuelling or excess expansion of the fuel after it is loaded).
The fire risk is minimized in three ways I can think of:
- The airplane is grounded to the fuel truck, minimizing the risk of ignition via sparking.
- The wing vents have flame arrestors so that if the air mixture leaving the wing did ignite, the flame would not make it into the tank.
- Atmospheric dispersion -- once the air mixture is out of the tank it will become more dilute with time.
In the cases there is more than vapor released, e.g. liquid fuel is expelled, these spills will be absorbed to minimize fire risk. In the ultimate case of fire the fuel truck has fire extinguishers and there is a fire station on the airport that can apply foam and water as needed.