Dear student,
The matchstick catches fire when rubbed on the rough surface of the box due to Friction.
As when we rub one surface over other, due to the relative motion of these two objects, friction generate. and friction produces heat. This heat causes the temperature change of the chemical present in the matchstick, and the potassium chlorate present in the head of it ignites, and catches fires.
Regards,