I found this about the mechanism of diarrhea due to allergies:
“Harmful irritants reaching the small intestine can initiate what is called a peristaltic rush, which can empty the entire small intestine into the colon within a few minutes. Food you are allergic to can also do this and lead to diarrhea due to the lack of time for fluid absorption.”
that would manifest as an “explosive fluid” diarrhea, I would suspect. Since it’s a “contraction of the gut” problem then you’d expect that diarrhea caused by allergies would respond to immodium.
However, when they treat chronic diarrhea in people due to inflammatory diseases they follow this dosage protocol. Your dog is about half the size of an adult human, so half the dose I would guess. It sounds like you might need to keep dosing repeatedly at first until you get the gut contractions to slow down sufficiently to control the diarrhea- they didn’t give up on the immodium until after ten days of treatment, see the text below.
"Adults: The recommended initial dose is 4 mg (two capsules) followed by 2 mg (one capsule) after each unformed stool until diarrhea is controlled, after which the dosage of IMODIUM® should be reduced to meet individual requirements. When the optimal daily dosage has been established, this amount may then be administered as a single dose or in divided doses.
The average daily maintenance dosage in clinical trials was 4 to 8 mg (two to four capsules). A dosage of 16 mg (eight capsules) was rarely exceeded. If clinical improvement is not observed after treatment with 16 mg per day for at least 10 days, symptoms are unlikely to be controlled by further administration. IMODIUM® administration may be continued if diarrhea cannot be adequately controlled with diet or specific treatment. "