Yes swimming and throat infections may have a relation, because the pool is a public pool it may contain various organisms which may aggrevate your tonsils problem.
Next Steps
If possible don't go for swimming for some days,
take antibiotics and steroids (to reduce inflammation and pain). it will get cured by this treatment
Health Tips
warm saline gargles 3 times a day