The mean value theorem is applicable because, if you fix one variable, the fact that the partial derivatives exist means that the (now one-variable) function is differentiable and they're just applying it in a small interval.

For n variables the argument is the same, although you'll now have to give n segments parallel to the coordinate axis and apply the same argument in each.