As long as the wire size supports the draw / load you can mount in a trailer behind the car.
Most people mount it under the dash or on the firewall.
the mounting as long as its secure and tight from vibrations again with proper load sized wire its were ever you want it.
Fire wall is good spot because you want it convenient if it craps out. You'll also be able to jump easily it if it does quit.
Of course I meant the relay not the pump on the firewall.Fire wall is good spot because you want it convenient if it craps out. You'll also be able to jump easily it if it does quit.
Does it matter, no. As mentioned, as long as wire sizing is appropriate.
I like to have the relay close to pump in case of any issues or testing for trouble. Fuse the supply side line going into 30 terminal on relay near the power source and go from there.