We had this with our dog as a puppy. We got him at 9 weeks from a woman who said that her son was allergic. A lie I now think, as he was suffering from diarrhea and sickness. After back and forth from the vet it was eventually discovered that he had cryptosporidium infection. Tried various drugs, and a very plain diet of steamed white fish and mashed sweet potato. He eventually came goodish, and is a big strong 7 year old now.
However, it was touch and go, and a long road. And he has been left with a very sensitive tummy, and poor immune system. He is always on the edge of tummy upset, is prone to itchy skin and had had anal furunculosis twice, and furunculosis on his snout. This is linked to allergy/poor immunity.
I don't think he will be ever completely well, and so much is now not covered by insurance. Basically anything related to digestion, allergy or skin.
I think he was badly bred, and was kept in poor conditions as a young pup, and was separated too young from his mum. I think his early life experience has a lot to do with his poor health. Obviously I don't have any science to back this up, its just a feeling.