It may seem like you're risking damage to your health or your car's health by cooking on your engine. But as long as you take some basic precautions, the process is harmless. For example, when you place your food package on the engine, there are some places you should avoid. Set the package away from any moving parts. In particular, stay away from the area where the gas pedal connects with either the fuel injection system or carburetor (depending on the age and model of your car). Placing a package here could prevent you from starting the engine, or worse, prevent you from being able to stop it.
Don't use hoses or belts to secure a package. While common sense may tell you to steer clear of the belts, the hoses are easily pulled loose. They don't have a great deal of slack in them. If you push a food package under a hose, it may not cause harm initially but could cause the hose to come loose while you're driving. Look at what's around the package when you place it. You don't want to block airflow to the engine or pull any wires loose.
You shouldn't try to cook stews or other liquid meals on your engine. No matter how well your meal is packaged, the vibrating engine will splatter juices and this may create smoke. In fact, a particularly fatty liquid, like the juice from cooking meat or oil, can cause a fire. Any food that roasts or braises should come out well on your car engine. Chicken, cuts of beef and potatoes are all good choices.
Remember -- safety first. Before you place your food package on the engine, turn your car off. Same deal when you remove the package. Even if you stop for a quick check to see how your meal is progressing, turn the engine off before opening the hood.
Otherwise, if your cuisine is done, set up a little picnic on the side of the road and enjoy.