Pressure in a pipe does indeed cause longitudinal expansion. Next time you go to a kid's party, try blowing up a long balloon and observe the far end !!

Incidentally, pipes also expand radially under pressure. This is not usually a significant effect, but it, in association with Poisson's ratio acts to reduce axial or longitudinal pressure expansion.