I personally can’t handle ice on my head with a headache or migraine—the extreme cold hurts and makes my headache worse.
I tend to use this instead: FROGG TOGGS Chilly Sport Cooling Neck & Head Band Towel, Size 7.5" x 33" https://www.amazon.com/dp/B00JH4H5AS/ref=cm_sw_r_cp_api_i_xSD0EbYBMTMC7
It’s only mildly cold. Just dunk it in water and wring it out. Stays cool for a bit, and is also fantastic on those awful hot summer days and after a tough workout.