The bottle which you consider to be empty is actually full of air. And air occupies space so when you submerge an empty bottle upside down in a tub of water, the air gets trapped into it as it have no space to come out. Since the space is occupied by air, water can not enter it but when you heat the bottle you can see the air coming out in the form of bubbles.This is because 0the heating process gives the air molecules get out of the bottle with high velocity.thereby overcoming the resistance caused by the water molecules.