One of the reasons I purchased the Sony Xperia Z3 was its advertised waterproof functionality and that is also why I have been considering the Xperia Z5. The Xperia Blog folks discovered that Sony recently changed its position on using your Xperia device underwater so don't do it.
Most of Sony's recent phones and tablets have an IP68 rating for the highest possible water resistance. In many typical usage situations, your phone and tablet will likely be fine. However, Sony's new guidance page on water and dust protection is pretty clear about its intended usage.
It was never clear in which type of water you could safely use your Xperia device as many of the promotional photos showed pool or beach settings. It turns out that the level of protection is only for fresh water and that protection is really just for accidental drops or usage in rain.
Sony hasn't updated all of its product pages yet though. For example, the Xperia Z3 Compact US product page still states, "Take pictures under water with a dedicated camera key."
No, don't do that if you want your warranty to stay intact and your device to keep functioning. This change in position is likely due to warranty claims and unhappy customers who used their phones in situations that Sony was clearly advertising. Sony did not provide a specific statement in regards to this change in stance, but its new waterproof support page is quite clear.
The Sony Xperia phones and tablets do still offer a very high level of protection, as long as you also remember to close all of the port covers. Sony makes it clear that you should check for small strands of hair or other objects that might get caught in the port cover.