Pools and wild water are different.
Opening your eyes underwater in a pool every so often is relatively safe as long as that pool is well-maintained with the appropriate concentration of chemicals. Long term exposure to chlorine can erode the front window of the eye - 'the cornea' - and cause dry eyes or other eye complications.
Wild water highly depends on how clean the water is. The best advice would be to choose a sea or lake etc that is known for naturally being clean.
Look at how clear the water is, and the kind of plant growth nearby (for example, seaweed is often a sign of a very healthy, clean sea). Animals (ducks, dogs) other than fish swimming in the water can make it more of a risk for bacterial contamination. In general, it is quite safe to open your eyes underwater in the sea.