Sometimes people on diets can have a little of the things they're offered. For instance, diabetics might cut down on sugars and carbohydrates more than usual the rest of the day in preparation for a special meal or someone with a mild allergy might be able to tolerate a small amount of something without a reaction. But others can't make even a slight exception. For example alcoholics can't accept a single sip of wine and some people with food allergies or intolerances might suffer serious symptoms after even one bite of a forbidden food.
So what is a person with food limitations to do?
Often if they explain the limits when accepting an invitation or tell others who push them why they can't share what is offered that will help. Perhaps they can eat part of what is provided at a meal or they can bring their own food, although that may be a problem in some restaurants.
If the gathering isn't a meal it isn't difficult to ignore the food provided and simply focus on conversations with others instead. And, if the people they're with are polite and accepting of differences, even at a meal it may not be necessary to say anything at all.