In the Japanese release, the player is able to use Dive on the deep water tiles in Team Aqua's hideout due to a programming oversight. Because these tiles were never intended to lead anywhere, diving in them simply teleports the player back to Petalburg City, the lowest-indexed map location in the game. In the international release, this error is fixed by disallowing the player from using Dive in the hideout.

This glitch is not present in Pokémon Ruby & Sapphire, because in those games, the entrance to the hideout is no longer accessible after obtaining the Mind Badge, which is required to use Dive in the overworld.
Contributed by game4brains
Attachment
Attachment