It's reported, but not conclusively demonstrated by experiment. Also, in some cases sex is known to cause migraine. I found absolutely no evidence for it being more than a temporary analgesic, let alone a cure.
source
Primary sexual headache
This is a well known ailment which affects about 1% of the population. There are three main kinds:
Early coital cephalgia, which is usually of short duration and moderately severe. It is a tight, cramping, dull pain, often occurring bilaterally in the occipital/cervical region, which intensifies as sexual excitement increases. […]
Orgasmic coital cephalgia, which is severe, of abrupt onset and lasts 15 to 20 minutes. It can be in the occipital region, behind the eyes, or in a more generalised form and occurs at the point of orgasm. […]
Late coital cephalgia, comes on after standing and may last for hours or days. […]
—source
Effect on existing headaches
The best study I could find — and the most cited article in recent popular press — was published this March 2013 in the journal “Cephalalgia”: "The impact of sexual activity on idiopathic headaches: An observational study"
Our data suggest, however, that sexual activity can lead to partial or complete relief of headache in some migraine and a few cluster headache patients.
Honestly, I think this is a big stretch on their side as the study is simply a scientific survey. It does not control for double blind, for example, and does not distinguish between real physiological effects and placebo.
Totally aside, but funny, here's a much less suspicious conclusion from the same study:
The majority of patients with migraine or cluster headache do not have sexual activity during headache attacks.