I'd like to know whether the phrase "in favor" can be used adverbially, e.g. They all voted in favor.
Yes. This is a common and natural usage. A quick google for “voted in favour” returns many such examples.
For example, here’s a Wikipedia article with that usage in the title: https://en.m.wikipedia.org/wiki/Causes_of_the_vote_in_favour_of_Brexit