Um, I really hope that they don’t! Lollipops have a lot of sugar, which can cause yeast infections. So if someone does decide to do this, make sure you thoroughly rinse afterwards!
But girls can masturbate with all kinds of foods, maybe a lollipop is used because they want to add a bit of flavor if someone is giving them oral afterwards.
Hope this helped! :)