There is the motion of galaxies THROUGH space. This is no different than a comet zipping through space, except in scale. For instance, Andromeda is coming at us like a freight train (should be here before Sol goes red giant).
Than there is the motion of galaxies IN space. Like everything else, galaxies are imbedded in the fabric of the universe. That fabric is expanding, carrying galaxies (and everything else) along with it.
Note that objects moving THROUGH space can not exceed the speed of light, while no such speed limit exists for the FABRIC of space. Galaxies can not move faster than light, but they can be carried away faster than light by the expansion of the fabric of space.