If the sensor is hermetically sealed then yes it can be used under water.  For example all our IMI integral cable sensors are IP68 rated.  If you plan to use the sensor for long periods under water then you need to make sure that the correct cable is selected and if the sensor does not have an integral cable then the purchase should be made with the "W" option to supply a fitted and sealed waterproof cable.