There are some very good home-made diets recipe, available from your vet that are healthy for your dog, but you must follow the directions and add vitamin and mineral supplements. Table foods that are bad for dog's are bad for people too: potato chips and other snacks, pizza crust, fat cut off of meat and poultry, and junk food for example, are not good for dogs. Excess fat in your dog's diet can lead to pancreatitis.
Most commercial food manufacturers are catching up with the times and producing much healthier, and more natural foods, which rely less on cheap grains and fillers, and use more higher quality protein sources, and vegetables and fruit.
Good commercial foods are Evo/Inova, Wellness, Orijin, and more. You must read every label and choose products without grains (including rice), but, do contain vegetables, fruit and meat, or fish or egg or poultry. Rice is OK to be used in the diet if your dog gets diarrhea, but is not necessary as a staple.
Allergic dogs must be exposed to the allergen in order to become allergic to it, and since many allergies are caused by heredity it is really difficult to prevent them.