I think a major factor in many people having sensitivities to gluten and casein is that modern life and modern diets are generally hostile to gut flora, which leads to a weakening of the integrity of the gut wall, i.e. "leaky gut". This allows undigested proteins to pass into the bloodstream, where they stimulate an immune response (because they're not supposed to be there undigested, they're supposed to be thoroughly broken down first, by proper digestion), resulting in sensitization and intolerance. I don't think you can necessarily say, for example, that someone of Swiss descent won't have a sensitivity to gluten from rye or casein from milk, just because those were the staple foods of their ancestors for many generations. They very well may have sensitivities to those things if their life, diet and environment haven't adequately nurtured appropriate gut flora, regardless of their genetic heritage. It seems to me that gluten and casein are being cast in the role of scapegoat lately, when in actuality the fault lies with other factors that created the gut malfunction to begin with (antibiotics, lack of probiotic foods and enzymes, use of antacids, over-consumption of nutritionally-vacant foods, etc.). It's not the fault of gluten or casein, per se, but rather of those many other factors that result in an improperly-functioning digestive system. I think in some cases, it's possible to heal a leaky gut, allowing those foods formerly not tolerated to be eaten safely.
Your own food sensitivities may have little connection to your heritage. I mean, to use the same example, you could be Swiss and sensitive to gluten or casein, if your digestion has become compromised at some point and triggered an inappropriate immune response. Unless you're living in the same area as your ancestors, have always eaten the same foods, and have an optimally healthy digestive system, I think deciding what to eat based on your heritage is academic, because so many other factors can influence how your body reacts to certain foods, factors that have little to do with your ancestry. That's not to say knowing your heritage and eating your personally traditional foods doesn't have value (I, for one, find it somehow spiritually fulfilling to know I'm eating and enjoying something my great-greats would have eaten), but I think it can distract from other factors that have a more direct impact on the healthfulness of a certain food for one's self.
Some things do appear to be heritable, like lactase persistence (the continuation into adulthood of the production of the enzyme that aids in digestion of lactose), but that's a separate issue from gut malfunction or allergic-type food sensitivities.