Jackets usually means outer garments, and these would be worn (on the journey) to school, and taken off on arrival.
Jackets that older children wear as part of a uniform, and which they might have to wear while they are "at school" i.e. in the classrooms - are usaully called "blazers"
I suppose this is an example of the special use of to plus zero article to indicate attendance at an institution. Have you been to hospital?
I am going to college.
I wore it to school.
He went to prison.
He wore a jacket to church.
He wore it to prison.
He wore his jacket to hospital.
I guess that there is only a very short list of verbs (and a rather short list of institutions) that follow this pattern.
Sorry for my delay in answering!
The exercise is about the use of the verb form "to be going to"; I noticed that "to" that sounded strange to me (I preferred "at"), but now it's all clear.
Thank you so much to all of you!