No, compounds do not cause a galvanic reaction. Compounds may corrode a metal, or attack it chemically, but the term galvanic action applies to less reactive pure metals in contact with another metal, in an environment where there's another, corrosive agent ...
Anyway, many people use phosphoric acids to clean rust off of iron. The phosphoric acid reacts with the clean iron to form an iron phosphate coating -- which is widely held to help protect the iron from future rusting. I don't know if you really get an good, uniform, iron phosphate plating with naval jelly or the like, usually such a coating is put on by hot dipping a cleaned part in an alkaline medium, or by electroplating. But at any rate, a little bit of iron phosphate may form, and it is a good porous coating that holds primer and paint better than a sanded clean iron part.