When a horse pulls a cart along a flat road starting from the state of rest, the horse applies a force on the ground in downward-back direction diagonally and as its reaction it moves forward. During this action there is also a reaction force by the road on the horse which exceeds the force of the horse on the ground and as a result the horse moves forward.
For pulling the cart the horse applies the force on the cart in the forward direction and as a reaction the cart applies a force on the horse in the backward direction which is less than the force of the horse on the cart resulting in the forward motion of the cart along with the horse.