Over a relatively long period of time, yes, it is feasible.
In fact, it most likely happened to our own ancestors. Our far flung ancestors were tree dwellers related to (ancient) chimpanzees. When they eventually descended from the trees and started walking across Africa's vast savannas they discovered that surviving as vegetarian scavengers is pretty tough going - especially when the competition has no such restrictions. They slowly became omnivorous. (this is obviously a trivialized version, please don't spam me with messages about my "ignorance")
In fact, modern chimpanzees also eat meat:
"When Jane Goodall first observed wild chimpanzees hunting and eating meat nearly 40 years ago, skeptics suggested that their behavior was aberrant and that the amount of meat eaten was trivial. Today, we know that chimpanzees everywhere eat mainly fruit, but are also predators in their forest ecosystems."
This is due to a simple evolutionary imperative: survival.
When a species limits itself to a certain diet it becomes vulnerable to the availability of that one food source. Should you move too far away from where those plants and fruits grow, you're going to starve. Should some disease or climate change wipe those plants out, you die.
However, if you also eat meat then you always have a high-energy food source to fall back on (assuming you can effectively hunt down some dinner).
And so, yes. If a certain herbivorous species found itself hard pressed for food, it it feasible that it might slowly convert to an omnivorous diet, and eventually maybe even to full-out carnivorous behavior.
However, this evolution might hit certain road-blocks, some of them fatal to the species. The animals in question must be able to hunt down some sort of food, must be able to rip into it, and then process (digest) the meat into useful nutrients. If the animal's digestive tract is 100% geared towards the very efficient processing of plant matter it is far less likely to be able to process meat. Its immune system might also not be able to deal with the various parasites and diseases it might ingest from its prey. There's probably a lot more considerations at play, however dinosaurs lived so long ago, and we know so little about their biology and physiology that you could probably get away with it.
Edit based on PipperChip's comment:
I never suspected that deer, and even cows actually eat meat. The reason for my surprise is that both deer and cows have digestive systems which are highly specialized with the aim of digesting plant matter and extracting as much nutrition from it as possible.
And yet, deer have been seen to feed on dead birds, fish, even other deer. Both deer and cows have been witnessed eating birds.
I found this sort of shocking because we all have this mental picture of deer and cows being benign vegetarian softies, however it makes perfect sense from a survival perspective.
Fun fact: even as late as the early 1900's people did not think that there existed "man-eating fish" (aka sharks). Or, if a shark was found to contain the remains of a man it was believed that the man must have first died in some other way before the shark ate his dead body. Now we know better.