Can having a stroke cause headache?

Absolutely! Either acutely with the stroke or afterwards when recovering or haveing recovered from the stroke, one can have headaches. There would be multiple reasons for this and not in the perview of 400 letter space here. Discuss your yoiur neurologist, pcp or neurosurgeon. Best to you.
Very often . Severe headache is one of the main symptoms of stroke, especially when characterized as "this is the worst pain in my life".
Definitely... Any form of head or brain trauma can cause headaches. Having said that, since there are so many reasons for headaches that range from caffeine withdrawal to brain tumors. You need to see a physician if over the counter medications are not helping.