I don't know about any potential fire hazard when filling up a gas can while it's inside the pickup.
What I do know is, I never would fill the gas cans while they are in the truck because I wouldn't want the gasoline running lose in the rear of my pickup.
It's hard enough to make sure no gas spills out when I'm filling them sitting on the ground. If I just stuck the gas nozzle inside the pickup and pumped away, I'd be way more likely to accidentally spill the gas.
The gas would be contained in the rear of my pickup since the gas cans ride in one of those black, heavy plastic pans used to mix up a small batch of cement which are sold by Lowe's or Home Depot. But I still wouldn't want the liquid gas sloshing around in the pan, and I wouldn't want to have to sop it up either.
What's hard about just pulling the cans out of the bed of the truck anyway?