that's different
fluorine, chlorine, bromine, and iodine are the "halogen" elements and theyre all very reactive
bromine is a better disinfectant for hot water and chlorine is better for cold water because of how well they dissolve in water at various temperatures; fluorine is too reactive (would react with the water) and iodine is rarer and less soluble
the way they disinfect is by being unstable and reactive and reacting with microbes and hurting them; because microbes are so tiny they dont have much protective skin so they are easily killed by reactive chemicals
in a big multicellular organism they only attack the very surface cells, and the cells are not destroyed so do not open up deeper layers when attacked
putting such things in pools isnt much of an environmental hazard because reactive things will quickly react with various chemicals and form stable compounds, and the levels are low
on the other hand, halocarbon chemicals such as CFCs specifically catalyze ozone decomposition, and are stable, so they tend to end up in the upper atmosphere without decomposing