Over short distances sure, but once you're talking thousands of km a pipeline is way simpler.
Simpler just to avoid all that and generate the hydrogen at large separate electrolyzers at the side of the utility-scale solar field (say), and then inject into the pipeline.