To prevent an unplanned barbecue in your rig, leave the gas can empty until the last gas station before the trailhead. Once on the trail, as soon as you have burned enough fuel completely empty the fuel can into the tank. Bear in mind that there is always a risk of fuel vapor escaping the can into the cab, so if you do store fuel in the cab you need to maximize ventilation.
In Tom Shepard's Vehicle-Dependent Expedition Guide, he has several examples of large fuel caches being stored in the vehicle (appropriately lashed). In his examples the vehicles are likely being driven at slower speeds in an African desert you've never heard of, all windows are open as there is no A/C, and the chances of a crash are low. His general guidance is avoid putting heavy things on your roof as it increases the center of gravity and diminishes handling (and in a crash what's on the roof can end up all over the road).