As Leonard Wolf points out, in The Annotated Dracula,
The footnote (#23 to Chapter 10) goes on to explain how garlic was used against witches and illnesses in Transylvania, and has been used as a remedy since Ancient Egypt.
Emily Gerad was the author of The Land Beyond the Forest, an important guide to Transylvania and, as far as I know, the first to draw a strong connection between vampires and Transylvania*. Stoker relied on it heavily in researching the background for his book. again, so far as I know, Stoker was the first to specify garlic as an anti-vampire talisman.** As I’ve pointed out elsewhere, Stoker presented his vampiric “facts” as genuine foklklore, but he really made many of them up himself. There’s nothing pre-Dracula about vampires not reflecting in mirrors, for instance. I suspect this is another of his fakelore inventions, and that Gerard’s mentions of the good luck, anti-witch properties ascribed to garlic in Transylvania is the reason you’re looking for.
as for the vampire-porphyria link, it’s overblown, as Barber points out in his excellent book Vampires, Burial, and Death. Some of the features used to correlate porphyria and vampires aren’t even part of the original vampire mythos, including red eyes, aversion to light (vampires were Creatures of the Night, but in literature they certainly walked around in daylight, at least until sunlight became accepted as the thing that Made Vampires Burn Up, which, despite its appearance in Nosferatu, didn’t really get :“legs” until Curt Siodmak (again! The man has shaped our monster beliefs) revived it for Son of Dracula and House of Frankenstein.
A quick perusal of Leslie Klinger’s New Annotated Dracula doesn’t add anything to this, but I’m probably missing it. This is one masive tome, and I ain’y going to search it now.
*The first asociation of vampires with Transylvania in fiction seems to be in Jules Verne’s Carpathian Castle, which predates Dracula. I suspect he got his information, directly or indirectly, from Gerard.
**He also has them use henbane, which hasn’t been remembered, for some reason. Not to be confused with wolfbane, Kurt Siodmak’s bit of anti-werewof fakelore that did make it into the public consciousness via the Universal movies.