I have always taken it for granted that in the case of Peter, the reference was to Peter denying Christ - That is, he wimped out and despite previous protestations about the strength of his support faded away...
(EDIT: The use of "Peter" as a popular euphemism for penis is even more obvious....)
I think it's help to look at the cultural context here. Since most English speakers across time will have had knowledge of the stories in the Bible even when there was little or no other literature available and the majority were illiterate, this obvious and widely shared reference makes sense to me as a probable source.
Likewise, the fact that "John" is probably the most common man's name is reason enough for it to be used for a generic male customer. ("Sheila", on the other hand, may have a more interesting story behind it.)
EDIT: Note also - lyric from Guys and Dolls
When you spot a John
waiting out in the rain
chances are he's insane
as only a John can be for a Jane
In this case "John" does not refer to a customer and a professional relationship, merely an ordinary male, and a romantic relationship. Again, simply indicate 'a man' by the most common name of 'a man'.
There will always be exceptions but I suspect that usually the simplest common archetype or cultural touchstone is a safe bet for a source.