Yes, it is legal under New York State Education Law §3214.

Under New York State Education Law §3214, a student may be suspended for up to 5 days if misconduct is alleged. During that time, a hearing must be scheduled, and the student must be provided notice of the misconduct they are charged with. On consent of the parents and the school, this 5 day timeframe may be extended.