The principle of conservation of linear momentum is applicable when no external force acts on the system. In this case, the horizontal forces are internal to the system (girl jumping onto the cart), and the wheels are frictionless, implying no external horizontal forces.