Q:

Why is there no explosion risk while there is a gasoil pre-pump immersed in the fuel tank?

Attached is the picture of a BMW 318 TDS Gasoil Prepump. That prepump is literally inside the sealed fuel tank.
And it contains a small electrical motor, in which 12V of electricity is sent, mainly when the car is turned on.
How on Earth can that be without any risk of explosion? There can easily be sparks inside the motor! And if there were some air inside the fuel tank, it would explode ...
When I think we are told not to have a phone call when filling the gas tank ...

A:

To add a little bit to Paulster2's answer the upper and lower Explosive Limits of Gasoline is 7.6% and 1.4% respectively. This means that a concentration outside of those limits will either be to rich or lean to burn. And since Gasoline's Flash point is -45 °F (-43 °C) it's pretty much always putting off vapors, which would push any air out of the tank. It's next too if not impossible to get a high enough concentration of air in the tank to make the the tank explode under normal conditions. 
As for the phone comment, outside the tank it only takes a concentration of 1.4% (not much) to catch fire.

A:

I pulled this from the talk side of Wikipedia page on electric fuel pumps, which I think explains it pretty well:

I am an auto mechanic who also has a chemistry background. The reason electric, tank- mounted fuel pumps do not cause explosions is that the concentration of fuel vapors is too high to allow an explosive mixture. The volatile (which in this context refers to a tendency to evaporate) nature of gasoline causes fuel vapors to take up any empty space as the fuel tank is emptied. Even if you completely empty a tank, open its access ports, and allow it to sit open, the concentration of vapors INSIDE the tank will still be too high to explode. Now, OUTSIDE the tank is a different story, and for this reason, one must use caution when performing any sort of repair or maintenance to a fuel tank, regardless of the type of pump used on the vehicle.

