A diver has escaped unharmed after a great white shark smashed into his viewing cage off the coast of Mexico.