The oldest published version I could find is the one on the image infographic. The one all us kids learned was:
"Do you know the muffin man
the muffin man
the muffin man
Do you know the muffin man
who lives in Drury Lane"
Neither version seems particularly dire or like any kind of warning. If you know the history of Victorian England, you'll know that vendors took their wares to the wealthier neighborhoods and London streets early mornings. The various sellers all had their own bit of doggerel they'd recite to announce their presences and promote their products.
If you've ever seen the 1968 movie "Oliver," you'll have seen a choreographed version of how sellers moved their product on the streets of London.