You get it after the 5th gym battle where you go next door to Wally's house and talk to his dad who then gives you surf.
You go to Steven's house in Mossdeep city. He's northwest of the Pokemon Center. When you enter, he'll give you HM08. HM08 (Dive) is exclusive to Pokemon Ruby and Sapphire and is obtainable in Mossdeep City from Steven who resides there. Steven
The most easiest way to get a Pokemon that can surf is get a Zizagoon,it can learn surf.
HM08 is only in ruby, sapphire and emerald.
Surf to an island
Surf Right of Lilycove
Any water Pokemon besides magikarp and also linoone can learn surf as well.
surf
Try to surf you may find it
In Pokemon HeartGold and SoulSilver Versions, HM08 Rock Climb is not needed to get to Seafoam Islands, HM03 Surf is though.
Although HM08 (dive) can be learnt by some Pokemon in the Fire Red game, you can only get the HM in the Ruby, Sapphire and Emerald versions of Pokemon.
hach an egg or surf
You have to surf from LILYCOVE city to the right