It really depends on the opioid in question IMO......
Is there a reason why you cannot use other, likely superior anti-histamine agents such as Hydroxyzine Hydrochloride (Trade name Atarax)?
If that fails:
-I have found in my years that:
-despite benedryl/dph possessing more antichollinergic/drying and other undesirable side effects vs the arguably therapeutic equivalent (or superior) yet RX-only hydroxyzine. Both are extremely common allergy medications of the 1st/(old) generation "sedating" antihistamine, both are used extensively and are mass-produced. Thanks to our governing agencies, hydroxyzine (Atarax; the antihistamine with (IIRC) the strongest histamine antagonism, minus the vast majority of the other commonly over-the-counter (in the USA at least) histamine antagonist / antihistamines.
I use Diphenhydramine HCl in the 25mg-150mg* dose range, (which again I must emphasize are not guidelines for those of you reading this to base your dosing off of, it's my personal experience (of which I have unfortunately required to acquire and retain extensive experience about allergy medications, antihistamines are pretty much the focusso fufiing rude] in that field...) and unique body chemistry means everyone reacts differently.
So what may work wonders for me, may not do a damn thing for you, and visa versa... (For example, any non-1st gen antihistamine don't work for me, like at all...; Claritin (loratidine) and it's ridiculously expensive new patented isomer desloratidine or whatever it is called. Cetirizine, (Zyrtec, which a decent portion of my hydroxyzine is metabolized into so no need to stack / double dose), and good Cetirizine ain't cheap either.
Most are a HUGE waste of my money because of my unique body chemistry. I'm also not responsive to other commonly advertised and sold "2nd generation", newer OTC/over-the-counter anti-histamines such as the 2nd generation "non-sedating" class which are not supposed to cross the blood brain barrier (BBB) readily like most of the older 1st generation anti-histamines.
I like hydroxyzine because it crosses the BBB so rapidly and thus I feel relief ASAP, taken at the first sign of allergies or when pre-emptively dosing in anticipation or for potentiation of the positive effects/alleviation of the negative side effects such as pruitis/itching, rashes, etc, (typical histamine response).
One major deciding factor is other adjunct medications in my bloodstream, such as the particular narcotic/opiate or opioid in question.
Another major factor is the anticipated dosing and consequently the impending allergic reaction, as first-line treatment for countering opiate induced histamine release in certain situations where other antihistamines are likely to be insufficient, such as when consuming the naturally occurring codeine or morphine alkaloids, in whatever form.
A bolus dose of oral Diphenhydramine is usually my last line of treatment if I'm taking my normal semi-synthetic pain medications. The only time's I know that I'll need diphenhydramine hydrochloride to begin with is when I'm taking naturally occurring opiate alkaloids and their extracts such as codeine, morphine, and countless other psychoactive alkaloids in the raw plant material, particularly the dried opium resin which contains the highly CNS and psychoactive opiate alkaloids, the natural ones from Papaver Somniferum which are often extracted and purified into pharmaceutical codeine and morphine preparations via various means, legitimate and otherwise. Obviously the most famous illicit semi-synthetic/tweaked version of morphine is heroin (Diacetylmorphine Hydrochloride as it's known in pharmaceutical form, but regardless of the formulation, it crosses the Blood Brain Barrier / BBB extremely rapidly due to it's enhanced lipid solubility, potency, and of course heroin is a prodrug for morphine and 3/6-MAM and a few other metabolites which create the "heroin high".).
Because codeine and morphine are both found in raw/unrefined/crude opium which is famous for its incredibly famous botanical species, Papaver Somniferum, or more commonly the Opium Poppy, which have been in use (and abuse) by humans since the dawn of time.
If there are no serious CNS depressant interactions to worry about, I would usually be sure to dose no less than 50mg Hydroxyzine (or Diphenydramine, provided you can't get the unscheduled yet RX-only medication for some reason in the USA) Hydrochloride, usually 100-150mg depending on my opioid dose (however factor in that these doses are not customized for your body chemistry, which is completely unknown to us on the internet).
I know some people that pass the fuck out and fall asleep after taking a single 25mg Benedryl (Diphenhydramine Hydrochloride) or 25mg Atarax (Hydroxyzine Hydrochloride)... even when not on other drugs.... so make sure that you start low and go slow as per common harm reduction sense. Try the anti-histamines on their own before combining them with such potent CNS-depressants especially before taking a triple digit dose.
Hydroxyzine and Diphenhydramine; they do technically belong to the old school class of 1st generation "sedating" anti-histamines, but again I am saying "sedating" because my own personal experiences (and repeated exposure due to severe allergies) have virtually eliminated any sedating properties of the usual antihistamines, "sedating" or not. Tolerance to the sedative effects of these anti-histamines builds rapidly within a few days of consecutive dosing.
Hydroxyzine > Diphenhydramine > Promethazine > Meclizine >
In my experience, Chlorpheniramine is rather ineffective and has way too many [particularly anti-chollinergic / drying] side effects to bear, just like doxylamine, cyclizine, etc.
$0.02, take it or leave it