This varies hugely dependent on many things such as how high your BG is typically and your personal pain threshold.
It is also confused by illness and stress causing BG to rise. So the headache maybe the cause of the high BG rather than the other way round.
As always, if your BG is high, it should be corrected, if your headache is bad, it should be treated and, throughout the headache, corrections, etc, you should test your BG to ensure it is coming down (and there is not something else wrong such as damaged pen/pump) or you are not going too low.