Virtually any water is safe for toilet water use as long as it has, at minimum, a "sand filter" of sufficient size to keep out sand and particulates. Even fresh water from a lake, river, or stream can suffice, with its entrapped microorganisms and impurities.
Ocean-going vessels utilize seawater for numerous functions, including firefighting and the supply plumbing of the urinals and toilets. This necessitates the use of stainless steel piping and fixtures for the toilets, but enables the use of the "free" water source that they float upon. (Granted, they may not be "flush" toilets onboard a ship, but the analogy is otherwise valid.)
For residential-grade installations, water quality will affect the looks and longevity of your piping and fixtures. If you are willing to use collected rainwater, then you can expect to suffer some additional costs of maintenance, filtration, storage, and possibly pumping that your neighbors wouldn't incur. Your tank and bowl might grow algae or become discolored without extra cleaning. An addition of copper to the holding tank or within your piping would help mitigate the algae. Even still, none of these factors affect the safety of the toilet: it will still work and not harm you.