Limited microbial exposure is suggested to underlie the increase of allergic diseases in affluent countries, and bacterial diversity seems to be more important than specific bacteria taxa. Prospective studies indicate that the gut microbiota composition during the first months of life influences allergy development, and support the theory that factors influencing the early maturation of the immune system might be important for subsequent allergic disease. However, recent research indicates that microbial exposure during pregnancy may be even more important for the preventative effects against allergic disease. This review gives a background of the epidemiology, immunology, and microbiology literature in this field. It focuses on possible underlying mechanisms such as immune-regulated epigenetic imprinting and bacterial translocation during pregnancy, potentially providing the offspring with a pioneer microbiome. We suggest that a possible reason for the initial exposure of bacterial molecular patterns to the fetus in utero is to prime the immune system and/or the epithelium to respond appropriately to pathogens and commensals after birth.