The only exception to this rule is the preposition 'to'. 'To' is often part of the infinitive, for example 'I want to go' or 'He decided to leave.'
In other cases, 'to' acts like a normal preposition, and is followed by a gerund (+ing form). For example, 'I'm looking forward to seeing you' or 'I'm used to working hard.'
All other prepositions ( on, by, with, from, of etc) are always followed by the gerund (+ing) form of the verb.