Can a GPS receive its signal from within the engine compartment of a vehicle
Probably not, GPS works with extremely weak EM signals from the GPS satellites. These EM signals cannot pass through metal. So if the hood is metal: no, won't work.

Also, if the engine runs on petrol, it has an ignition. This produces disturbances which will disturb GPS reception.

Even on a diesel which has no ignition there are many parts with active electronics in the engine compartment which will harm GPS reception. 

All in all: I think you would be extremely lucky if the GPS worked at all.