Headaches in general are quite poorly understood, and there are a number of different types of headaches, with a very large number of conditions known to cause them.1 A common denominator though seems to be blood flow,2 which makes sense considering the importance of keeping the brain properly oxygenated. Too little blood to the head and you can lose consciousness (which evolutionarily is very bad, because an unconscious monkey can't defend itself or its kin). Too much blood and you risk improper brain function in the best case, and hemorrhaging into the delicate brain tissues in the worst. For this reason and others, blood vessels in and leading into the head are often covered in nerves. Major changes in blood flow putting pressure on these nerves can cause headaches.2
Glyceryl trinitrate patches work so well for angina because nitroglycerin is converted in the body to nitric oxide, one of the body's own primary vasodilators, and vasodilators serve the role of causing blood vessels to widen.3 In the chest, this widening helps the heart to function. In the head — which the nitroglycerin eventually reaches as it is systemically absorbed — vasodilation allows blood vessels to hit these nerves, and there's your headache.
Sources: