Can lightning damage electronics via a ground connection?
There is one cardinal mistake. The water pipe may not be used as ground, rather a water pipe has to be grounded. Grounding the pipe provides safety to the user if some device, for example boiler malfunctions so that you don't get electrocuted in bath.

It is forrbiden to attach other devices to the pipe to serve as ground point.

When the lightning strikes a grounded object, the current passes through and the entire grounding potential becomes V=I*R_ground. It is self explanatory that having good ground makes this voltage very small.