Could there be an adverse reaction if I smoke marijuana while on headache medication?

Yes. Unless you grew and harvested the marijuana yourself, you don't even know what's really in the stuff. It's quite common for marijuana to be adulterated with other substances. Certainly marijuana can worsen the headache. It's possible the marijuana use is triggering, or at least worsening, the headache in the first place.