This phrase is very specific to "The Three Little Pigs". You won't find it anywhere else, and you won't see it varied in ways that change its rhythm. If it does appear elsewhere, it's an allusion to this story.
As for what it means—all you really need to know is that the sentence as a whole means "No, absolutely not."
The role of the word "by" is the same as in the idiom "to swear X by Y": historically, "if I'm lying about X, let God destroy Y" (where Y is a thing of high value to me, so you know I'm not lying). Here, if refusing to let the wolf in would cause the pigs to lose their chin hair (which evidently they highly prize), they still wouldn't let him in.
I don't recommend analyzing children's stories to this degree. Understanding the story is one thing, but you shouldn't expect that you can always apply what you hear to everyday English, as some of it is just nonsense made to be appealing and memorable.