This NGram shows relative frequency of occurrence for all three prepositions following prerequisite.
Three separate "wildcard" NGram searches for "prerequisite of for to" ALL show the SAME three "most common following words" in the same order for each preposition (the, a, any).
Note that prerequisite to has voting and obtaining as the 7th and 8th most common words following to, and ...for has voting in 10th place. Those are the only instances of (gerund) verbs.
Also note that although the charts show no instances off a gerund verb being in the "top ten" for of (only to and for), these are only relative usage tendencies. As this Google Books search shows, there are many instances of prerequisite of voting from published writers over the years.
Although there are no instances of prerequisite [to verb] in any of my above searches (where to is an infinitive marker, not a preposition), the format does occur occasionally (church attendance is not a prerequisite to go to heaven), but it's not common (it's usually prerequisite for going to heaven anyway).
TL;DR: The infinitive verb form is rarely used after prerequisite - but if it is, no preposition is included. Other than that, usage isn't really consistent enough to justify worrying about choice of preposition - but if you need a guiding principle, just use the current favorite for in all contexts.
FINALLY: See this NGram for in order to (a prepositional phrase) showing the most common verbs following as be, achieve, understand, make, avoid, determine, obtain, establish, have. Given that voting is the only gerund to appear in more than one "single-word preposition" context, I can't explain why prerequisite in order to vote doesn't occur more often. I just take that as further evidence that there aren't many meaningfully consistent usage patterns in this general area.