St. John’s dragon in a chalice is almost as common in some churches as St. Michael vs. the dragon/devil. There’s a lot of different stuff behind this.
1. Pretty much everybody in church history identified St. John the Apostle with the author of the Book of Revelation. (And “the beloved disciple,” too.) The Book of Revelation has a dragon in it (the one menacing the Woman Clothed with the Sun), so there’s an obvious association of ideas. (Sometimes St. John even gets pictured with the monsters of Revelation, which is cool if you like many-headed monsters on your stained glass.)
2. St. John and St. James (the “brothers of thunder”) used to share December 27 as their feast day. They were associated with the chalice as a symbol, because (after they angled for thrones next to Jesus) of the fulfilled prophecy that they would both “drink from the chalice from which I will drink” by suffering similar troubles. The confusion lies in that Church also carries a chalice in scenes of the Crucifixion; and that Jesus had another prophecy about John (the ‘hey, what business is it of yours when John dies’ prophecy/snark), and in fact John didn’t get martyred. So it’s a little bit confuzzling as an attribute.
3. However, there’s a legend that John, fulfilling Jesus’ prophecy about being able to drink poison, either drank a poisoned cup of wine at a feast without harm, or that when he said Grace over the wine, a vision of a snake/dragon of poison appeared over the glass so that John and everybody else were warned, or that a snake/dragon actually slithered out of the glass and out of the room with the poison. This made for a cool stained glass scene (chalice plus big bitey snake, or chalice plus little flappy dragon) or statue or painting.
This also made St. John one of the patrons of wine and winemaking. (This was particularly fitting, since wine often is associated with fervent love in the Scriptures, and St. John’s Gospel is particularly associated with love.) This was particularly handy on his December 27th feastday, because it was still the Twelve Days of Christmas and a time to be merry.
So on Dec. 27, people would (and still do) bring some of their wine to church and have it blessed by the priest with a special blessing. When blessed by a priest with this old prayer, the wine, called “St. John’s wine” or “the love of St. John,” is actually a sacramental, not just blessed for usefulness like a car. So people would pour it into their wine barrels at home to bless all the other wine. People would save it and give to the sick or dying, or use it for peacemaking when needed. But most of all, people would drink “the love of St. John” to each other at dinner that night. (In Austria, the Family Von Trapp learned to have the older members drink to the younger, all around the table, saying, “I drink you the love of St. John,” which was answered by the toastee, “Thank you for the love of St. John.”)
It is also very nice to give one of your blessed bottles to the priest, so that he shares the merriment too! (And if he doesn’t want to drink it himself, I’m sure he’ll know who can use a nice bottle of the Love of St. John.)
So St. John’s dragon in the chalice is really more of an obedient answer to prayer than a totally bad dragon; and he’s associated with merriment and salvation.