A two year old child does not yet understand the difference between what he is supposed to put in his mouth and what he should not put in his mouth. When he looks at a plastic ring, it could be food or a toy. The way to tell is to taste it.
As a parent, the only thing you can do is make sure that there are no small objects that your two year old can get to, and keep reminding them by saying, “That is a toy. We don’t eat toys, we only eat food.” It’s also helpful to restrict eating to one place in the home such as the kitchen table. This may help reinforce that rule that we only eat food.
Once your child is older, he will learn to explore with his hands instead of his mouth and by the age of 4, most children have stopped this behaviour.