Yes, you can safely swim while on your period with or without a tampon

If you're choosing a feminine product to wear while swimming, experts recommend either tampons or menstrual cups.