Food counts toward the "base" production of settlers and workers, so yes, the base production will be add to the OF from a whip. Ideally you work your best tiles with remaining citizens after the whip button. However, note any production bonuses to settlers/workers from traits (IMP/EXP). Those trait production bonuses specifically apply to "hammers", not food, so a mine might provide more base hammers than a farm in that case.
It's pretty easy to see this on the production bar in the city screen. Just adjust citizens to different tile improvements and note the base hammers into the settler or worker that turn and go with the larger combined total of food/hammer production. The whipped excess production into settler/worker plus base production that turn will go to OF (minus any limit to OF..forget what that is) next turn.
so, for a simple example - off top of head so some inaccuracies are likely:
you 3 pop whip a settler at 39/100 production. 3X30 = 90 so:
39 + 90 = 129/100 production into settler for 29 OF. However, say city is working corn and 2 mines, plus city center for roughly 16H of base production with remaining citizens. That should give you roughly 45H of OF. However, there may be more complex things maths under the hood like rounding down or adjusted food calcs that changes that number.
The OF hammer total next turn can be applied to anything but will also be multiplied by any bonuses to whatever item you build next that has a bonus, like a resource or IND bonus wonder.
Another way to look at this is that settler/worker whips are a great way to turn food into hammers, especially in high food/low hammer cities, but also certainly early on in good food caps to get off to fast starts one way or another.