The literal translation of the Hindi sentence is 'There is pain happening in my head'.
This is because Hindi does not have a commonly used verb equivalent to 'to pain'. दर्द (pain) is a noun. So, it is used along with the verb होना (to be) to say that the pain is present.
Also, you can simply say 'मेरे सिर में दर्द है' (literally: 'There is pain in my head') for 'I have a headache' The sentence 'मेरे सिर में दर्द हो रहा है' is explicitly in the present continuous because of the 'रहा है' which is why 'aching' is used.
I believe it's needed because this is in the present continuous, i.e. it "is hurting" (as opposed to "hurts"). So, I believe if you left out the हो रहा it would mean "my head hurts."
The हो specifically is the root of होना, "to be," which is then paired with रहा to make the present continuous.
Apart from the fact that in English it would be "I have a headache", yes it should be accepted. (The use of definite and indefinite articles is something that seems to trip up a lot of non-native English speakers).
Sometimes this app insists on an exact literal translation or marks it wrong, other times it wants something with the same meaning and will mark a literal translation as incorrect. There doesn't seem to be any rhyme or reason to it, I can only assume it's the work of different people without one fixed overall editorial standard.