Yes, anxiety seems to cause headaches. There are multiple studies showing that anxiety and stress are associated with headaches (Senaratne et al., 2010; Jorge et al., 1999; Mercante et al., 2011). In addition, people with headaches have less problem-solving skills and higher levels of stress and depression (Eskin et al., 2013).
So if you have headaches and you also have anxiety, then engaging in CBT (cognitive behavioral therapy) to reduce your anxiety symptoms and improve your coping skills to deal with stress may also reduce your headaches.
References:
The prevalence of migraine headaches in an anxiety disorders clinic sample. Senaratne R, Van Ameringen M, Mancini C, Patterson B, Bennett M. CNS Neurosci Ther. 2010 Apr;16(2):76-82.
Cluster headaches: association with anxiety disorders and memory deficits. Jorge RE, Leston JE, Arndt S, Robinson RG. Neurology. 1999 Aug 11;53(3):543-7.
Primary headaches in patients with generalized anxiety disorder. Mercante JP, Peres MF, Bernik MA. J Headache Pain. 2011 Jun;12(3):331-8.
Social problem-solving, perceived stress, depression and life-satisfaction in patients suffering fromtension type and migraine headaches. Eskin M, Akyol A, Çelik EY, Gültekin BK. Scand J Psychol. 2013 Aug;54(4):337-43.