Yes you can do this.
I swim pool laps five times per week with my Apple Watch Series 8, previously with a Series 4. The lap counts are accurate. To ensure the accuracy of the heart rate I always tighten my watch band before entering the pool.
On the watch I’ve configured my Pool Swim Workout Metrics to show the following: Time elapsed, Current heart rate, Maximum heart rate, # of laps, Total yards
However without an iPhone you’ll not be able to access all the additional metrics in the Fitness app on the phone.