What education did Mozart receive in order to know basic harmony rules, like consecutive fifths are bad?
As pointed out, he was educated by his father. He would have received basic training in Rule of the Octave, counterpoint, etc. Instruction in Mozart's time was essentially in voice leading, not harmony: harmony training didn't really exist until Chopin's time.
And how did he make sure his compositions do not have errors?
Errors are passages that do not make sense, that sound wrong, in the prevailing musical language of a particular historical period. Mozart had a thorough exposure to the music of his time at a very early age, and the kind of apprenticeship he went through with his father meant that he had an experienced Master to point out potential pitfalls.
Note, however, that composers like Mozart frequently "break the rules" when they need something striking, but they generally do so in a way that has a solid grounding in their era's musical language. If I recall correctly, Piston's Counterpoint points out a passage by Haydn where he used parallel fifths (slow movement of the Oxford Symphony?), but the passage maintains contact with the language of the period by presenting the the parallel fifths as the upper voices of a series of parallel first inversion chords, parallel first inversions being common practice at the time.
Did he have to check every voices one by one, or did he use writing patterns to avoid mistakes?
In general, music is patterns. Mozart would have had a fair number of patterns at his fingertips to work with. You might find reading about partimenti and the Rule of the Octave interesting.