Are there existing electronic sensors that can sense if underwater or not?
There are a few types of water sensors, with varying levels of applicability to the purpose stated in the question.

At the simplest level are electro-conductive sensors, essentially a pair of zig-zagging exposed conductive traces along a PCB, with a small gap between the traces. If the device is submerged in water, there is conduction between the traces, which would indicate presence of water. Of course, the traces must not be covered by solder mask.

From this site

Since the conduction of electricity through the water is dependent on electrolyte / ion content in the water, results vary depending on the water quality. Further, due to corrosion and oxide build-up, the longevity of these sensors is very limited.

If the water tank in question contains somewhat impure water, then a long strip, or several short strips, of such sensors made of standard PCB may serve the purpose. Since the "sensor" is inexpensive to make, regular replacement is an easy recommendation. 

A variant on this theme is the use of microstrip antennas, essentially the same concept of PCB traces, but designed to be energized via a radio frequency signal. As the dielectric between the two conductors varies with humidity, moisture and of course submersion, the resultant change in antenna load can be used for detection. See this publication for additional information.





More sophisticated sensors use a stack of hygroscopic material, and a limit micro-switch, to detect water. The hygroscopic material expands in moisture / water, tripping the limit switch. Such sensors may falsely trigger in high humidity, such as in an enclosed water tank.

Even more advanced sensors exist for the type of function described, but they are typically for industrial use, and are very expensive, if at all sold in small numbers.



Although this is not the question asked, an alternative approach is to use an ultrasonic or infrared proximity sensor to sense the water level from above, and thereby determine how full a tank is. 

Similarly, there is the classic float sensor, which consists of a floating ball attached to a lever, that acts upon a flex sensor or absolute rotation sensor, to determine the level of water. 

These approaches may well be more reliable to implement, than the submersible sensor approach.

See also: All the answers to This question, and this other one. 

Suggestion: Research Rain Sensors for other options.