“I wasn’t so sure myself, Ma’am.” Others, however, became very sure. They invented an Elijah who rode to the rescue of many. A rabbi in Belarus, for instance, wrote how Elijah rescued a too-trusting travelling salesman. The salesman got into town just as Sabbath was about to start and needed a place to stash his cash. Jews are not supposed to carry money on the Sabbath — you knew that. Well, the salesman went to the synagogue and saw a man wearing little leather boxes.
The more religious Jews put these boxes with scripture verses inside on their hand and forehead as a literal way of doing Exodus 13:16, “And it will be like a sign on your hand and a symbol on your forehead.” They call little boxes “phylacteries,” an old word meaning “guards,” because they guard the wearer against forgetting the Lord’s teachings.
The little boxes made the salesman think he could trust this man to hold his money for him. So he gave him his purse until the Sabbath was over. Some interrupted this story with, “How was it legal for one person to carry money and not the other?” But most just let the story flow.
When the salesman came back after the Sabbath, people said, “You gave your money to that hypocrite?” Not to worry, for that night Elijah appeared in a dream and showed the salesman how to get his money back from the swindler’s wife.
The interrupters again: “Just what did Elijah suggest? Show up at the door with a knife? Hire goons to harass the wife?” But experienced story tellers kept a straight face. “The rabbi in Minsk did not reveal Elijah’s tactics.”
A Rabbi in Poland then started the story of the sympathetic dogs. He told people that because Elijah rescued so many Jews from so many troubles in so many places and so often, their dogs learned his scent. This story caught on with Hebrew dog owners because they saw how their pet senses mood changes, feeling sad or happy in harmony with the mood of master.
When dogs smelled Elijah on the air, they knew their masters would soon be released from certain calamity and be happy. Before long, people all over the Diaspora knew that when their dogs began making happy puppy noises, Elijah was nearby, doing a good deed. Some parents told tiny children that if they would study their lessons intensely enough, when the Sabbath came, Elijah might show up and let their dog take a whiff.
 http://www.jewishencyclopedia.com/articles/5634-elijah Pesiḳ. R. xxii.; Yer. Ber. ii.