Yes, it is generally safe to pee in the ocean or any other body of water. Urine is sterile, so it will not harm you or the environment. In fact, some marine animals may even be attracted by your urine, although this usually only happens if you're diving in very clear water. So go ahead and release that bladder while diving – just be considerate of your surroundings and make sure to pee away from your buddy!