L.B.
My first thought,
Do you give her lots of attention when she does this?
Is she smiling when she does it?
Just saying "Ow" does not really indicate pain - what is her tone of voice, facial expressions, etc.
Many toddlers latch onto a behavior that we laughed at once and/or gave them lots of attention when they did it. They then continue to do it for the attention factor.
Before diagnosing her with OCD (which is abundant in my family) try ignoring her the next time she does this, and the next time, etc. See if the behavior goes away.
Good Luck
Hugs