Apparently the tradition can be traced back around 200 years to an occasion when a fearless London chimney sweep stepped out into the path of the runaway horses & carriage of King George III (a yapping dog had startled the horses).
The King was so thankful that he took off his hat and bowed to the humble chimney sweep that had saved his life.
Later, when the King's youngest daughter was to be married, King George sent for the chimney sweep because he believed that the presence of this chimney sweep - perhaps any chimney sweep - would bring good luck and happiness to his daughter in her marriage.