You need to look at a particular phone’s specifications. There’s an international ingress protection (IP) rating standard that indicates just how well a particular phone resists dirt and water. If it doesn’t have an IP rating, it might be waterproof, but you’ve only got the maker’s word for it.