This is not quite true. The original gas pipes in most cities were built for "town gas" which was produced from coal and is 50% hydrogen by volume. The infrastructure could handle hydrogen just fine, but the low conversion efficiencies make it impractical.
Let alone the compressors or the flow measurement equipment. Also significant portions of the pipesline (especially in neighborhoods / last mile) aren't metal anymore.