Yep, exactly. I can't even say which one i use more often, "Я голодна" or "Я хочу їсти" when i want to say I'm hungry, both are fine.
I think Duo didn't accept it because "Я хочу їсти" is literally "I want to eat" rather than "I'm hungry" (Я голодний).
But on the spoken level these phrases should be interchangeable: very often in a situation where an English speaker would say "I'm hungry", a common way in Ukrainian would be to say "Я хочу їсти"...
So, I'm not sure whether Duo should accept it as a translation, but you can surely use it this way :)