It depends on your symptoms and the activity. An ear infection can affect your sense of balance, and having uneven balance makes many exercises dangerous. You also should avoid getting anything in your ear, such as water—which means swimming should be avoided. If you have an ear infection, it may be a good idea to talk to a healthcare provider first before working out.