Gerund after Preposition

Here is a good rule. It has no exceptions:

Prepositions are always followed by a noun-phrase.

If we want to use a verb after a preposition, it must be a gerund (which functions as a noun). It is impossible to use an infinitive after a preposition. So, for example, we say:

Notice that you could replace all the above gerunds with "real" nouns:

The above rule has no exceptions! So in the following sentences why is to followed by "driving" in #1 and by "drive" in #2?
  1. I am used to driving on the left.
  2. I used to drive on the left.
Answer

In #1 to is a preposition followed by a gerund or noun, as per the rule above:

  • I am used to driving on the left.
  • I am used to animals.
In #2 to is not a preposition. It is part of the to-infinitive:
  • I used to drive on the left
  • I used to smoke.