Yes it's okay to pee in the ocean.
I've peed off a boat into the ocean before and I've even been swimming in an ocean and peed my pants in there as well.
Peeing in an ocean or lake is not gonna harm the water or the marine life in the ocean or lake as your pee will be diluted really good by the mass amount of water in the ocean or lake.
I've peed countless times in an ocean and lake and nothing bad has happened.
When you have to pee you have to pee and you should do so either on the ground or into the lake or ocean.
If you're swimming in a lake or ocean and need to pee then there's no need to get out of the ocean or lake and go to a restroom.
Just pee your pants and the water will wash off the urine on your pants where it won't smell.