Yes, the chemicals would effect the hay (straw) used for the goats. Most of the foggers have instructions towards protecting any people containers used for holding or eating food, wiping down counters after use, and such. The poison would contaminate the hay (straw) unless it was taken out before hand. There is a period of time enclosed areas have to be vented for airing, Even then, the smell lingers and is absorbed by the soft surfaces, and hangs around for a long time. I am pretty sure goats wouldn't want to eat hay that carried the chemical smell, even taken out before hand, once it absorbed the smell when it was put back inside the storage shed.
What type of problem are you having inside the storage shed, maybe there are other alternatives.
What type of problem are you having inside the storage shed, maybe there are other alternatives.