Can nux vomica work for migraines/headaches?

Nux vomica. Yes, this is sometimes recommended, usually for headaches triggered by rich foods, or associated with gastric symptoms, sometimes alcohol associated headaches. Others discussed include epiphegus, glonoine, belladonna, and iris versicolor but typically a homeopath would recommend taking your specific case to choose what is appropriate.