Early steam locomotives normally travelled forwards only.
Most modern diesel and electric locomotives can run equally well in either direction, and many are push-pull trains with control cabs at each end.