Moll Flanders got her name because a moll was a street-fightin' whore. Not the other way round! And a moll was a moll simply because Mary was by far the most popular name for a girl, so any woman you met was likely to be a Mary herself or have a sister, a cousin or an aunt who was one; this made it the perfect choice for a runaway or anyone wanting to disappear in the city crowds. Just as there are plenty of Irish guys whose names are neither Pat nor Mick, but Pat and Mick are what they are likely to be called; and finding an Irishman if all you know about him is that he was known as Pat or Mick would be megatricky.
My unBritish impression is that as nicknames for Mary go, Polly might just be, and/or have been, somewhat higher on the social scale than Molly. The Anthony Powell novel called 'At Lady Molly's' always gives me a slight jolt. But maybe we get it wrong in the (former) colonies, dahling.