In many cases, a foil is so integral to the main plot that you might consider them the protagonist. Two characters can also be each other's foils, so it's okay to blur this line in your writing.  A memorable example of this would be Hannibal Lector in The Silence of the Lambs. Dr. Lector is the depraved foil to Agent Clarice Starling's by-the-book and somewhat naive personality, but you also would not have a book or movie without him. Some would consider him the protagonist.