Some of us are omnivores, but even we can have food problems. I have a food intolerance. That is not the same as an allergy because there is no reaction like a rash, but my body rejects and quickly eliminates a certain food. With that condition, I am ready to accommodate any diet problems my guests have. There are a number of issues that come with such precautions.
First, a host needs to know about these things. I ask people I invite to tell me about any food restrictions they have. Likewise, it is not at all rude for a guest to tell hosts about diet issues when accepting an invitation. Otherwise both host and guest are unhappy.
The cook then has the job of making an appropriate menu and investigating product labels in order to make sure offensive things are not present. This is easier today in some cases with heightened awareness of gluten, peanut and other widespread offenders. Corn is ubiquitous and very difficult to avoid. Food can be mislabeled, however.
Food concerns like these discourage many people from inviting others to dine in their home. Restaurants also try to inform customers of ingredients but that can be cumbersome and might stifle creativity. Potlucks and buffets are dangerous or less pleasant for the food-sensitive person.
These considerations can diminish one of the oldest forms of social life: eating together. If fear of serving food to friends and family lessens communal dining, much more than nutrition is lost. There is something magical about the companionship that occurs when people eat together. Hospitality is a major virtue in most ethical codes. Be brave; invite people to dine with you in spite of diet fears.