I don't know about a limit on how many gallons of gas you can carry in the bed. If there is, nobody's enforcing it.
At the off highway vehicle riding areas in California, most folks carry several 5 gallon jugs of gas for their bikes, buggies, etc, usually in the bed of the truck, or on the trailer. Also, toyhauler trailers often have built in gas tanks with a pump, for filling the toys, which are often 20 gallons or more.
On my welding truck, the gas self-generating welding machine has a 12 gal tank, the gas air compressor has a 2 gal tank and I carry usually one, or sometimes two, 5 gal cans of extra gas. DOT and OSHA haven't complained about anything yet.