No, generally you can't get an STD from swimming in public pools or hot tubs. But the risk of getting an STD depends on many circumstances. Having sex in a pool or a hot tub, though, is quite risky. The risk is not the same for all STDs. Also, it is not the same in both circumstances. For example, you have higher chances of getting an STD in a hot tub than in a swimming pool. In other cases, the full act of sex is not necessary for catching an STD in the water. All you have to do is a little bit of foreplay. 

Sex in the pool. Is it dangerous?

Unprotected sex is dangerous everywhere, not only in your bed. Although pools have chlorine to kill the pathogens from humans and the environment and to keep the water clean, the chlorine cannot prevent STDs from spreading through sexual contact. STDs are transmissible through genital fluids. During unprotected penetrative sex, genital fluids pass from one partner to the other, regardless of where the sex takes place. Therefore, the chlorine present in the water of the pool does not have the time it requires to kill the pathogen responsible for the STD. Urinary tract infections (UTIs) and yeast infections are among the most common diseases that people can catch by having sex in a pool. However, common STDs such as chlamydia, gonorrhea, and syphilis are not rare. It is necessary to mention that swimming in a public pool puts you at remarkably low risk for catching an STD. Keep in mind that STD transmission requires skin-to-skin contact or exchange of genital fluids.

I had sex in a public pool. Did I get an STD?

It is reasonable to worry about catching an STD from having unprotected sex in a public pool. If you think your partner transmitted an STD to you, all you have to do is get tested. If your partner told you she or he has an STD, you should probably get tested for the very same pathogen. If your partner hasn't informed you about any STDs, but you are still worried, you can get tested for some of the most common STDs, such as chlamydia and gonorrhea. Testing at home with an STD rapid kit test is a simple and accurate way to find out if you have an STI. Therefore, instead of stressing out, you can diagnose any potential STD early and treat it effectively. 

Sex in the hot tub. Is it dangerous?

Hot tubs are generally more dangerous than pools when it comes to STDs. The high temperature of the water in a hot tub favors the survival of pathogens. Sometimes, sex is not even necessary to contract an STD in a hot tub. Sexually transmitted pathogens can pass in between the fibers of swimwear, making infection a possible scenario. Therefore, even though there is an already existing risk, it may escalate in the case of sexual contact. As always, genital fluids are necessary to spread or get an STD. The risk of infection decreases in case the genital fluids remain in the body. Therefore, in the absence of sexual arousal, the chances are remarkably low. Casually being in the same hot tub with an STD-positive individual won't give you an STD. Sexual activity, however, might put you at considerable risk.

I had sex in a hot tub. Did I get an STD?

Most STDs are asymptomatic. Therefore, it is very tricky to tell whether you have one or not. The key is to get tested. If you exposed yourself to an STD through unprotected sex, get tested for it. It is fine to worry about your health. All you have to do is find out early if you have one or not. Early diagnosis and intervention are essential, especially for some of the most dangerous STDs, such as HIV and hepatitis. Keep in mind that not knowing you have an STD might put your and others' health in danger. If you think you got an STD from having sex in a hot tub, you can get tested at home with an STD rapid kit test. Get tested for the most common STIs and get early treatment. STD rapid kit tests provide you with quick and accurate results at home and in less than twenty minutes.

Having sex underwater makes condoms less effective

Chemicals found in pools may weaken the condom, making it less effective. Therefore, even practicing safe sex underwater does not mean you won't get an STD. Extreme temperatures, such as those found in hot tubs, might also alter the consistency of the condom, making it less effective. Ineffective condoms are sometimes more dangerous than having unprotected sex because you might expose yourself to STD without knowing it. Therefore, having used a condom, you wouldn't think of the possibility of having an STD. Keep in mind that most STDs are asymptomatic and they might present with symptoms later in the course of the disease. Their complications might be irreversible and life-threatening. Therefore, condoms are not the ultimate shield against STDs. Knowing about safe sex also includes where it is safe to have sex, even if it is protected sex. 

Prons and cons of underwater sex

Underwater sex might sound cool and might be one of the fantasies of most couples. Even if it looks sexy, underwater sex might get quite uncomfortable. Although having underwater sex might fulfill a sexual fantasy, it might also give you STDs or unwanted pregnancy. Also, underwater sex might get painful. Water can wash off your natural lubrication. In other words, it might dry you out. Not having sufficient lubrication might result in pain during or after penetrative sex, for both sexes. Therefore, instead of having sex under the water, you could sexually arouse your partner with your hands. Using your hands and fingers is a less risky way to turn your partner on and can be a type of foreplay before having safe sex outside the pool or hot tub. 

READ
What kind of foreplay could not cause an STD ?