Although boil-outs and cleanouts are done regularly on boilers (with the result that plumbing codes now require backflow preventer installation to safeguard against inattention – leaving acidic poison in the boiler that could flush into the city water mains) , doing this to domestic water applications is IMO looking for disaster.
There are citric cleaners, but I am suspicious of ANY chemicals that can be ingested when left in a line or may weaken the heat exchanger of a high-pressure vessel like a gas water heater. These appliances are inexpensive enough to replace – and I think a new one is the cheapest insurance to be found.