I assume that it does, because で or を doesn't really makes sense. Since で indicates that I'm going in school, and 学校 isn't really a direct object. Or is it?
Japanese Language Stack Exchange is a question and answer site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language. It only takes a minute to sign up.Sign up to join this community
You can use either に or へ here. As mentioned in @EddieKal's comment, both of the following are correct:
In general, you can use the above two interchangeably :
In actuality, native speakers use へ and に (of point of contact) almost interchangeably except in the case of
There isn't any flight to / as far as New York any more.
✖ ニューヨークにの便はもうありません。(に cannot be followed by の)
I arrived in Tokyo at 12:00 o'clock.
 A Dictionary of Basic Japanese Grammar p. 302 (ni7 に)
 A Dictionary of Basic Japanese Grammar p. 116 (e へ)
 A Dictionary of Basic Japanese Grammar p. 117 (e へ Related Expressions section I)
学校へ行きます is more common.
When using "へ" you are referring to a place/direction, while "に" you could use for other verbs.
People often use に because they are assuming they are entering the building "School".
Go to cinema:
Entering the car: