in this question
we have taken the angular momentum about the point c but we can
see that there has been a torque acting during the collision
which tends to rotate the body of mass M . this
could have been true when we have taken any point in the line of
momentum of mass m because then the toque about that point
is 0 as the line of force passes through it . But as shown in
figure we have taken the point C to observe the angular momentum
because the toque is acting about the point C

You can conserve angular momentum of rod + particle about any fixed pt in space

But then that force may produce some net torque so how angular momentum conservation can be applied