Can I swim after an eye infection?

Yes. Once you have recovered completely give yourself a few weeks and with the clearance of your ophthalmologist, you may resume your normal activities. You may feel more comfortable wearing goggles while swimming.
Depends. On what type of infection and how long it has been. I would ask your treating doctor.