Many land animals have returned to the sea throughout evolutionary history. We have beautifully documented cases from amphibians, reptiles, birds and mammals from over 30 different lineages over the past 250 million years.
Our dear penguins, seals, sea lions, walruses, whales, crocodiles and sea turtles were once entirely terrestrial. Some species dipped a toe or two into freshwater ponds, but make no mistake, they were terrestrial. Each of these animals had ancestors that tried out the sea and decided to stay. They evolved and employed a variety of adaptations to meet their new saltwater challenges. Some adapted legs as fins, others became more streamlined, and still, others developed specialized organs to extract dissolved oxygen from the water through their skin or gills. The permutations are endless.
Returning to the sea comes with a whole host of benefits but some serious challenges as well. Life at sea is very different from life on land. Water is denser than air, impacting how an animal moves, sees and hears. More importantly, it impacts an air-breathing animal's movement on a pretty frequent basis. If you need air and haven't evolved gills, you need to surface frequently. Keeping your body temperature at a homeostatic level is also a challenge as water conducts heat much better than air. Even with all of these challenges, the lure of additional food sources and freedom of movement kept those who tried the sea in the sea and they evolved accordingly.