Some drain cleaners are considered safe for use in toilets and sewer pipes. These are Eco-Friendly and Enzyme-based drain cleaners, such as Green Gobbler and Flow-Zymer.
However, harsh drain cleaners can destroy PVC toilet plumbing which is very costly to replace.