Well, there are many 18 year old seniors, and most public school districts will take kids up to 21 for a variety of reasons. These older students may not be in the regular ed classroom, but it wouldn't immediately be illegal for an adult to be in high school.
It would be hard for some who was much older to pass as a HS student. If they got caught, they could probably be charged with fraud or impersonation. Also, if they went into bathrooms or lockerrooms, they might get stuck with a sex charge,