I really doubt that diphenhydramine has any direct effect on the majority of migraines. Its mild serotonergic effects may have some value as an adjunct (that is essentially how the triptans work), but I wouldn't be confident in that. As a local anesthetic, it is probably given in far too small of doses to have any appreciable sodium channel blocking effects on the cranial nerves. Lidocaine is a much more reliable sodium channel blocker and it takes essentially a toxic dose of IV lidocaine to work on migraines. Diphenhydramine's biggest value in this setting is probably as an anxiolytic.
Migraines and cluster headaches are actually etiologically complex and variable. Like most chronic pain syndromes, what works for one person often won't work for another person as well. The most reliable rescue treatments are probably triptans and the D2 antagonists (metoclopramide, prochlorperazine, droperidol, etc.).
Things like ketorolac, diphenhydramine, etc. might work for some people but probably aren't really the most effective choices in general. They just find their way into the "let's throw the kitchen sink at this thing" approach that a lot of clinicians take.