In Portugal, they may use these verbs differently. In Brazilian Portuguese though, we have:
MACHUCAR: the act of hurting, mainly in a physical manner, but also metaphorically. It demands a direct object.
"Ben hurt his sister with that action figure over there" = "O Ben machucou a irmã com aquele
boneco ali."
"That girl hurt me with those words" = "Aquela garota me machucou com aquelas palavras."
DOER: Feeling pain, used with parts of the body. It can be used metaphorically too. It doesn't need an object (intransitive verb).
"My leg hurts" = "Minha perna dói."
"My soul hurts" = "Minha alma dói"
MAGOAR: to hurt metaphorically only
"Her attitude hurts me" = "A atitude dela me magoa."
"Sometimes it lasts in love, but sometimes it hurts instead." ="Às vezes permanece com amor, às vezes, em vez disso, magoa."