Can you get them both identical things, like the exact same outfit (for occasions like Christmas, of course, where you might get both girs gifts), so that there would be no point in the older sister appropriating the younger sister's gift?
I remember when I was a new mommy, I had a crib set up for my DS, who was a newborn. He didn't sleep in it yet; he slept in a cradle by our bed so he was close by so I could nurse him. But he had this room that I'd spent time decorating, etc. My first baby....a lot of thought and work went into it, KWIM? DH's sister and BIL visited, overnight, to see him, with their DD who was about 9-10 months old. I was adamant that their baby not use our DS' crib, even though DS didn't use it yet. I couldn't explain it to my DH (at least in a way that he understood). He didn't care. But to me, it was a big deal that my DS would be the first one to sleep in HIS OWN crib. (Plus, SIL was kind of the golden child, as was her DD, who was the first grandchild. They could do no wrong. So I was probably just projecting my worries about the future and if DS would get shuffled aside all the time b/c his cousin was first and was the golden child, so I was trying to start from the outset and not let her take over his bed that he'd never used.)
Of course, now it sounds silly, although I'm sure there are some people who could relate to how I felt at the time. Both kids are in high school now. But it was a big deal to me then. And I think that despite the family situation, the OP should find some way that younger niece's gifts can't be given to older niece. And despite the family situation, I think it would be a kindness to the older niece in the long run to not let her get away with this, whether it be making a point about the hat, or some other method.
OP, would it be possible to gift the three year old with something at the 5 year old's next birthday? So as to not disrupt the birthday celebration, could you preemptively tell the 5 year old that her little sister will be getting a gift too, and that's only fair since the older sister not only took the younger sister's hat, but damaged it too? And your gift to younger sis is to make up for that, and she is not to touch it or else? I know she's only 5, but let her stew on it for a while. Actions have consequences. She needs to realize that, even at 5. If she wants to be the only one getting gifts on her birthday, then she has to act appropriately with other people's gifts at their birthdays. I still remember a defining moment from my childhood when my father punished me for something. Looking back on it now, I was totally being a brat and I deserved it. And let me tell you, that punishment made an impression on me, so much so that I still remember it.