A.W.
Its easy for toddlers to do thing s that are strange or even "inappropriate" because they don't understand yet.
To be frank, it probably feels good. And she doesn't know any better so she does it because it something new she's discovered she can do that feels pleasant and doesn't seem to be "not allowed".
You could begin teaching her that playing with her peepee isn't clean and that because its where her potty comes out of, she shouldn't do that - but try not to discipline against it... you do not want to create shame!
I come from an extremely conservative family. As a little girl I wore panty hose and shorts underneath even long dresses. I was so heavily sheltered that I couldn't even leave the bathroom naked, I had to dress after a shower with the door closed before I could come out and go to my room. It gave me such a huge self-esteem complex that eventually led to a lot of problems between my husband and I sexually.
I'm just saying all of this to illustrate how easy it is for well meaning parents to really screw up and not even see it.
She'll stop after you begin teaching her that she shouldn't because it isn't clean. As she gets older and can understand more, you could teach her that it isn't bad or wrong, but that people shouldn't touch themselves in public.
The rocking is probably just associated with comfort and good feeling. She may just be daydreaming and rocking because its a comforting habit.