It has nothing to do with GIVING the fetus an allergy but exposing the fetus to something s/he’s allergic to. I’ve read all the studies since I’m one of those that has a potentially fatal allergy to peanuts and nuts. From my own experience, those of my brothers (who all have it as well), those I’ve talked to who have it (well over a hundred by now), and the studies I’ve read that I considered at least halfway sensible, it is about genetics and exposure. You are either allergic to something or you’re not. You cannot make yourself allergic to nuts. You can make yourself not LIKE to eat nuts by overly gorging on them but that’s about it. Both of my parents loved and ate nuts and yet all their children (four sons) are allergic to them. I also know people who are also allergic to nuts and whose mothers were as well so they definitely didn’t get any as fetuses nor as young children. It’s in our genetic make-up. As for exposure, the more exposure you have to nuts, the more severe your reaction … if you’re allergic to them in the first place.
When I was young, the only thing I did when I accidentally ate a nut was throw up. Then when I was in the military and eighteen years old, I had an unusual reaction after eating at the mess hall. I didn’t throw up but felt sick and my salvia started to flow like crazy. Being 18 and fresh out of the nest, I called home and talked to my mom about what was happening to me. She figured it must have been the apple pie that I ate as the only thing that could have had nuts in it as some make it with pistachio nut flakes. As I was just coming off grave shift and feeling VERY tired at the moment, I was going to then just sleep it off, but my dear dear sweet mom was relentless in telling me to get myself to the emergency room. She even threatened to call my commanding officer to get me to do it. In the end, she got me to promise her I would go right then to the emergency room and knew I wouldn’t break such a promise once made … though it took her a while to get me to make it. She also wanted me to get someone to walk with me there, but I thought that was way too unmanly and since she didn’t extract a promise from me on that point, I didn’t. So I walked to clinic that was a half mile away (I was stationed at the huge Charleston Air Force Base) with a big wad of tissue paper to try and soak up the salvia that was now drooling out of my mouth as I was then having problems swallowing it. It just so happen that Sick Call was being done at this time. Now if you haven’t been in the military, Sick Call is when you show up claiming you’re too sick to work. Note the word “claiming”. Everyone assumes you just want to get out of work and are thus faking it. The medical staff that processes you treats you as a slacker and thus generally despises you as wasting their time. But I was there and didn’t realize what was really going on inside me so I simply got in line for Sick Call. I waited as the line moved forward slowly. By the time I got to the front of the line and the male orderly snarled “What’s your problem?”, I couldn’t speak anymore. He repeated his question and acted as if he was waiting to see a really bad acting job about to be performed. Then his whole expression changed as he saw me drool out salvia into the wad of tissue paper as I was trying to answer him. He stood up with a start and shouted as if I was deaf: “Can you talk?!” I shook my head the negative.
Then the “fun” started.
In a blur, the orderly rushed me to the emergency room side of the clinic as the orderly was yelling for help. Nurses came running out of nowhere as did a doctor. The four of them practically carried me into the operating room. Then a very rapid game of Twenty Questions was played after the doctor quickly looked down my throat. I being only able to answer “yes” or “no” with head movements. I tried to write “nut allergy” but my hand was too weak by this time to even firmly hold onto a pencil. Oxygen loss they later said, but I think I was just too freaked out by their reactions. Anyway, when the doctor asked the $64,000 question: “Are you allergic to nuts?” and I nodded the affirmative, I was shot up with two big shots of epinephrine. I then sat there with two very attractive female nurses holding my wrists constantly monitoring my pulse. The US military never does anything by half-measure. laugh However, I think the mega-dose of epinephrine was totally unnecessary. All they had to do to get my heartrate through the roof was what they did next. They wheeled in a tray that had tracheotomy surgery tools and told me that if the epinephrine failed, what they were going to have to do and that this was my last hope. And if that wasn’t enough, they also wheeled in the “crash cart” (cardiac arrest jumper cables … a.ka. defibrillator) in case they needed to jump start my heart if the epinephrine fried it. Oh, it was at this time that I finally understood the severity of what was happening to me. 
I was the first brother to have such a severe reaction but now all of my brothers do. In fact, my two oldest brothers (I’m third in line) have to have bee sting kits all around their houses, where they go to work, at all their friends’ homes, and in all the purses of their wives. They cannot carry the kits in one of their pockets or in car glove compartments as heat damages the epinephrine. Additionally, their wives and secretaries have had to be trained how to properly administer the injections in case they find my brothers already passed out due to oxygen loss. chuckle A joke of my older brothers is that their main fear is that they’ll simply be taking a nap at their desk and get woken up by their secretary stabbing them with the injection needle. 
Just recently after another visit to the emergency room (I don’t yet need bee sting kits and can get by still with Benadryl) and a lecture from the emergency room doctor, I no longer go out to eat. I prepare all my food at home. Since doing this, my close calls have been VERY few and only from food manufacturers that don’t properly list their ingredients or how their food has been prepared. Naturally, I read the ingredients on EVERYTHING I buy, but some manufacturers just don’t care I guess. They don’t realize that even the smallest amount of nuts or making stuff on the same machinery that had once processed something with nuts can be potentially fatal to people like me.
Needless to say, I am very glad that the food industry and medical profession are now making a big issue out of nut allergies. I think it is NOT over-reaction, but at last a sensible reaction that’s LONG overdue. Sorry, but I don’t really care to anywhere the same degree if someone smokes next to me as opposed to eat a nut next to me. I now get sick off of the nuts that is carried on the vapors coming out of that person’s mouth. I also get sick if an open container of nuts is around me. All those “natural” food stores are off-limits to me since they love to have open barrels of nuts in them for customers to scoop out bag-loads. Recently, I heard that McDonald’s at least no longer sprinkles nuts on their ice cream sundaes but hands out nuts in plastic packets to customers to do so themselves. While I applaud this step, it is still too little for me to eat at their restaurant chain. Although the food staff handles nuts less, there’s still nut traces all over those nut packets which then gets on the food staff’s hands and, besides, the customers then simply open up those packages out in the dining area. However, when McD gets rids of all nuts from their restaurant, they will get in return a very loyal and regular customer. 
Oh, and that last emergency room doctor pulled no punches when lecturing me. He told me that I can smoke all I want, eat all the fatty foods that I want, get the darkest suntan, never exercise, live in an X-Ray room, and drink so much booze it floats my liver. Why can I do all that? Because that’s not how I’m going to die. I’m going to die one day because of a nut reaction. A reaction that will be so severe and fast for the bee sting kits to be able to counter it nor will I be able to be rushed to the hospital in time. That, he said, is how I will die. The only question is when. On the bright side, he said I can have a great deal of control over how long I can hold off that date with the Grim Reaper. The fewer exposures to nuts I have, the longer I’ll live. Thus why I don’t go out and eat at restaurants anymore. 