Birds can’t chew; that is why they have gizzards. After all, you can’t do much with a beak, which doesn’t have teeth and lets the bolus fall off. Older non-avian dinosaurs like hadrosaurs, ceratopsians and even some therizinosaurs could process food with their teeth, but birds cannot, and this has been used as the main reasoning as to why modern ecosystems have a distinct lack of giant herbivorous birds, while herbivorous mammals are abundant (neverminding that ostriches, rheas, elephant birds, eogruiids and dromornithids have co-existed throught the Cenozoic with large herbivorous mammals, and that tortoises and other non-masticating critters have been able to effectively compete with mammals as well).
Except that’s not really the case. Some birds, like hoatzins and cuckoos, seemingly can engage in some rudimentary form of mastication, using their bills to triturate food before consuming it (Korzun LP et al. (2003) Biomechanical features of the bill and and jaw apparatus of cuckoos, turacos and the hoatzin in relation to food acquisition and processing. Ostrich 74: 48-57.). The main counter argument against mastication in birds, that the bolus would fall off without lips of any sort, has been counter argued before, and many birds developed tooth-like structures in their bills. So, birds with the capacity to masticate, to chew effectively, is definitely a possibility, provided the right set of circumstances occurs.
Which brings me to the most likely candidate for such an evolutionary path, anatids. Anseriformes are notable for their bizarre tooth-like serrations, the lamellae/pecten. Pecten are present in all waterfowl, and seemingly evolved for filter feeding, but they have since been refined for a variety of purposes, such as the fish-grabbing, truly tooth-like merganser pecten:
In herbivorous waterfowl like geese and swans, the pecten serve mostly to help the animal rip out plant material, much like the grooves in the beaks of other herbivores like tortoises, or the teeth of non-masticating herbivorous animals like iguanas. Jumping from simply ripping to trituration would be easy; it’d just start as additional bites before consumption, then progress into full blown mastication. Some adjustments would be necessary, mainly in changing the shape or orientation of the pecten in order for them to be useful in trituration, but as seen before they are plastic enough for this to be possible.
More interestingly, waterfowl mastication could be facilitated due to another characteristic: cranial kinesis. Like many other birds, Anseriformes can flex their upper jaw, largely thanks to an articulation that seperates it from the rest of the skull. In a controlled form, this could help to progress the development of mastication a lot, as all the bird would have to do would be to move the upper jaw – or sections of it – as the mouth closes, making the pecten slide against each other, instantly pulverising any plant matter in the beak. This method of mastication would be very similar to that practised by hadrosaurian dinosaurs, which engaged in a more controlled form of maxillary kinesis:
Doing this would mean a very efficient form of chewing with minimal changes to the pecten’s orientation or shape.
Furthermore, remember the aforementioned lack of necessity for lips? Waterfowl “beaks” are largely just composed of keratin-reinforced skin, with the rhamptheothecae limited to the “nails” at the tip of the jaws. As you can see in the above pictures, “lips” of a sort already exist, so if there was an actual need for lips, it’d be solved rather quickly.