Dharma is the teachings of the Buddha, but once you have right view/understanding (8 fold path) you will begin to hear dharma everywhere, not just in Buddhist books but in other religious teachings, in nature, in situations, and even in your own breath. So in a larger since, dharma is the reality of things, the way things are, or truth.
Dharma is also the path. Reality, or truth as we perceive it, is our path and our practice. So the dharma is our practice, our teachings, and also the way we experience reality. Of course, that’s just my perception at this moment.
So when we take refuge in the Buddha, Dharma, and the Sangha, we are taking refuge in the example of Siddhartha, yes, but also refuge in the possibility and the nature of who we are (Buddha), refuge in the teachings, the path, the practice, and reality itself (Dharma), and refuge in the community, spiritual friends, and realization that we are all one and no one is separate from us (Sangha).