It is necessary to distinguish between situations. If you are a resident student, the school has clear disciplinary regulations, and you are not allowed to go out for meals and activities without permission. If students run away from home, the school can't force students to eat at school.
However, if it is in a special period of the epidemic, it is reasonable for the school to reduce students' going out as much as possible for the epidemic and let students eat at school.