Take a look at Managing Migraines During Pregnancy?
This is a very complex question. You didn't say whether you're asking about acute medications to take when you have a headache or preventive medications for frequent headaches. In either case, options are limited. Most medications are FDA pregnancy category C, which means one of two things:
Animal studies have shown an adverse effect and there are no adequate and well-controlled studies in pregnant women. or No animal studies have been conducted and there are no adequate and well-controlled studies in pregnant women.
What's safe for one person during pregnancy may not be safe for another because of other medications they're taking, issues with their pregnancy, or other medical issues. The only person who can answer this safely for you is your doctor.
Congratulations and good luck with your pregnancy,