The problem isn’t the container, it’s the air inside the container. When cabin air pressure is reduced, from whatever it was on the ground to the cabin pressure at altitude, the volume of air trapped in your pen or tube of hand cream or shampoo bottle or liquor bottle also expands.