If you recorded your dreams, over a long period of time, your dreams will change from things in your known environment, to themes which become more mythological. These appear from the unconscious mind, since the ego is asleep. These symbols start to piece together things in unique arrangements not seen in nature. These type of dreams are symbols that personify various aspects of the unconscious mind. Often what happens in history, is someone important has one of these key dreams, which then becomes part of a cultural mythology. While the observation that dragons are common to so many cultures, suggests that all humans are grounded on the same unconscious foundation, allowing parallel development of common themes. Once these key dreams or visions are externalized, they will resonate in others since they touch the same deep places of the psyche.
In middle ages mythology, the dragon is often portrayed as guarding a treasure. This is the Treasure that is hard to obtain. In this mythology the Knight needs to muster all his courage, to seek out the dragon, and confront him in the dragon's den, to extract the treasure.
This dream symbolism was connected to the dark and middle ages taboos about the unconscious mind; instincts that was imposed by the Church. There were conscious rules of behavior that required one be with the church program, and not with any of the impulses from natural instinct. This was the devil. The dragon personified instinct, unconsciousness and even Satan. The unconscious was very scary due to the centuries of conditioning.
Yet, this inner source of impulse was sensed to be good and useful; treasure. A Knight was someone with lots of autonomy and authority, as given by the king. He personifies will power and choices, apart from the collective mind. But even to such a person of choice, the unconscious mind was not something to be approach lightly. It was symbolized as a dragon. Yet the knight had to confront this, to extract the good or treasures that comes from natural instinct.