Guinea pigs are natural swimmers but may not appreciate being put into the water. They will swim if forced by being placed in water but often find it distressing.
A good way to determine if a particular guinea pig enjoys swimming is to test its reaction when giving it a bath. Placing a guinea pig in a few inches of water to gauge its comfort level will provide a basic idea as to whether or not that guinea pig enjoys swimming.
If a guinea pig does enjoy swimming, it should only be allowed to swim in fresh water pools. Saltwater and chlorine-treated water is harmful to a guinea pig's health.