Yes, "to" is a preposition: Tom goes TO a good school. When it is part of an infinitive, it is no longer called a preposition but simply the sign of an infinitive: I want TO LEARN grammar. And sometimes you may not use the "to" of an infinitive: He made me DO it.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.