A portable air purifier can meaningfully reduce headache frequency for some people and will do absolutely nothing for others, and the deciding factor is what your trigger actually is. HEPA filtration removes airborne particles: pollen, dust mite debris, pet dander, mould spores, wildfire smoke. It does not remove gases, odours, formaldehyde, carbon dioxide or humidity. If your headaches track particle exposure, a correctly sized unit run continuously in the room where you spend the most time is one of the better-evidenced interventions available. If they track pressure, sleep, hormones, dehydration or screen time, the purifier is an expensive white noise machine.
The honest summary of the research is that filtration reliably reduces measured indoor particle concentrations, reliably improves some cardiovascular and respiratory markers in controlled studies, and has been studied far less for headache specifically. Most of what we can say about headache is inferred from allergy and air-quality symptom data rather than from trials with headache as the primary outcome.
That is not a reason to dismiss the idea. It is a reason to test it properly on yourself rather than buying on the strength of the marketing.