In the 1970’s and 1980’s there were several books the either had characters that did it or promoted it.
Why is there no cooking tray in my new car’s engine bay?
Is it dangerous? (It would be less physically dangerous if there was a specific spot for it.)
It’s really inefficient. A stove has all of the heat being concentrated to one spot while a car has a whole cooling system spreading out and dissipating the heat, and cars are more efficient at that than in the 70s. Having enough heat to cook with is generally bad for an engine so by design you would want it to cool before it’s that hot.
I have had a few coworkers who put their lunch containers in their engine bay so that it would heat up for lunch though, that was for a job that had us driving around to 3-7 jobs in a day.