I can certainly attest to this, having suffered four such episodes on long-haul flights, two of them extreme.
Environmental factors in airplanes may precipitate headaches. We conducted a questionnaire-based study among consecutive travellers to determine the rate, severity and duration of flight-associated headaches (FAHA). Of the 906 eligible travellers (mean age 33.3 ± 13.8 years), 22.3% reported headaches at least once per month. FAHA occurred in 52 travellers (5.7%), of whom 34 were women (P = 0.0023 vs. none FAHA). The duration of pain was 4.0 ± 10.2 h after takeoff and continued for 5.7 ± 14.2 h after landing. Migraine was diagnosed in 19.2% of those with FAHA. The magnitude of headache was 6 ± 2 (on a scale of 1–10). Among those who suffer from FAHA, 45.4% reported that their pain was unilateral, in contrast to 72.7% among those with 'non-flight' headaches (P = 0.019). Nine travellers had headaches when descending to −400 m below sea level, and nine upon climbing to high altitude. This preliminary observation indicates that FAHA is not uncommon and should be further investigated.
Reference: I Potasman , O Rofe & B Weller, Flight-associated headaches—prevalence and characteristics, Cephalalgia, Volume 28 Issue 8, Pages 863 - 867, 2008