If you are referring to mother's milk, most babies are not allergic to it. However, sometimes the diet of the mother, may include some proteins that could affect the milk and may cause digestive upset in the baby. In terms of a mother being allergic to a baby, there is a situation involving the Rh factor differing in the mother and baby causing an immune response, almost like an allergic reaction. For example, if a child has Rh positive blood(inherited from its father) and if the mother is Rh negative, although their blood doesn't mix, after the birth of the first baby, some of the Rh positive antigens enter the mother's bloodstream and she becomes sensitized. She begins to produce anti-Rh antibodies. By the next pregnancy, if her next child is Rh positive, these antibodies can cross the placenta and can attack the baby's red blood cells. This can produce anemia (the blood has a low number of red blood cells). This condition is called hemolytic disease and can cause brain damage, illness, or death in the child. Fortunately, in this situation,an injection of Rh immunoglobulin can be given to a mother before she becomes sensitized preventing this reaction from occurring.
Yes, a baby can be allergic to the mother. Allergies are antigen antibody reactions. Anyone can be allergic to someone else. An example of an allergic reaction in utero is the disorder of erythroblastosis fetalis. On a first pregnancy, Rh positive blood enters the mother's circulation while delivering a Rh positive child, if the mother is Rh negative her body will produce anti Rh antibodies. If the mother becomes pregnant again and if the baby is Rh positive, the mother will produce antibodies against the baby's blood, the child's blood agglutinates or clumps, causing erythroblastosis fetalis resulting in fetal demise.
Fortunately, this can be tested for while the mother is pregnant and she can receive treatment that will prevent the disorder from occuring.