Unless you have an open cut, bacteria are unlikely to cause infections. The bigger problems are viruses and fungi. Herpes can cause painful rashes; papillomaviruses and molluscum may turn into warts; and fungi can lead to athlete's foot and nail infections. Thankfully, you can protect yourself easily.
Wipe down equipment with an antiseptic wipe or paper towel before and after use to eliminate the moisture in which viruses and fungi thrive. If you work out daily, alternate between two pairs of shoes, and allow each to dry out completely before wearing again. (Gym shoes are a common source of moisture that can harbor dematiaceous fungi and lead to athlete's foot.) Be sure to towel off frequently during play. Since respiratory illnesses are easily transmitted by air, choose a workout space that's adequately ventilated.
In the locker room, wear flipflops to prevent wart infections and athlete's foot. Be sure to dry off after a shower or sauna; retained moisture on your skin can cause infection in your hair follicles from your own skin's bacteria and occasionally from water-borne bacteria.
Always check with your doctor for specific questions related to your unique situation or health conditions.
—Peter R. Williamson, M.D., Ph.D., associate professor of medicine, pathology, microbiology, and immunology at the University of Illinois at Chicago