Your gas can won’t explode, BUT if you fill it all the way up it’s important to note that gas fumes expand with temperature.
So say you have a 20 liter gas can and you fill it up in the morning to 20 liters – if there is a significant heating during the day the volume of that fuel can increase as much as two to three liters.
Your can might be rated to hold up to 21 liters, so if it expands to 22 liters with heat that extra volume is going to need somewhere to go – past the seal. So don’t fill them up all the way to the top, give your can room to expand.
A general rule is for every 40 degree F change in temperature, density will change a half a percent. This is also a great reason why you fill up your gas in the morning. It has a higher density than it would at hotter times of the day. Be careful when opening your can on a hot day just in case, fuel may go everywhere.