Sure, an iPhone can survive water. Most iPhones are rated at IP67 which means dust/water resisant – note that this means resistant, not water proof. Water can and will still get inside – this IP rating should be purely used as a benefit to you if you accidentally get your phone near water. Your phone is an electronic, it shouldn’t be near water at all, just like many other things.
General wear and tear on your device and if you’ve had screen replacements can also severely impact the water resistance on your device. For example, when replacing an iPhone screen on a 6s and above, the device should have a new water seal. This helps to keep water out, but will never be good as the original Apple one when replaced.