The most common location for the fuel pump on modern vehicles is inside the fuel tank or mounted underneath the vehicle on the frame rail somewhere between the fuel tank and the engine. Some modern vehicles com with two fuel pumps, one in each of these locations.
Almost all modern vehicles feature fuel injectors that require the delivery of fuel at a higher pressure than older engines that utilize a carburetor. Locating the fuel pump inside the fuel tank helps create higher fuel pressures. Also, the fuel pump is immersed in the liquid fuel that helps to cool the pump and prevent it from igniting extremely flammable gasoline vapors.
Some cars use a twin fuel pump system, with one pump inside the fuel tank to transfer fuel and a main pump outside the tank.
Older vehicles sometimes use a mechanical fuel pump outside the fuel tank to deliver fuel to the carburetor to start combustion.