Chemical drain cleaners can damage pipes, especially with repeated use or when they sit on a full clog. Caustic (lye) and acid openers heat up as they react, which can soften plastic joints and seals, and they speed up corrosion in old cast iron and galvanized lines. Enzyme products are gentle but do not clear clogs.
The risk depends on the chemistry and the pipe. Lye and acid openers work by reacting with the clog, and that reaction gives off heat. On a fully stopped drain it has nowhere to go, so it pools and keeps working on the pipe, the glued joints and the rubber gaskets. Metal pipe fares worse. Acid and caustic products attack iron directly, and a cast iron line that is already thinning from the inside has little wall to spare, which is why the guide to cast iron plumbing says to keep them out of those drains entirely.
The bigger danger is often to people. Drain openers can contain lye, sulfuric acid or hydrochloric acid, which can burn skin and eyes on contact. Never mix two products or follow one with another, and never plunge or open a drain that still holds cleaner, because the standing water is caustic. If chemicals are in the line, tell the plumber before any work starts.
One honest limit: an occasional dose in a sound, modern PVC drain is unlikely to ruin it. The more common problem is that the product rarely clears the real clog. Hair and soap film resist it, so it may open a narrow channel and leave the rest to rebuild. Enzyme treatments suit monthly upkeep, not a drain that has already stopped, and the mechanical methods for unclogging a sink without chemicals are safer for the pipe and for you.