Dharma is one of those words that resists translation because it names a relationship rather than a thing. In Hinduism, one’s dharma is the right pattern of action for one’s place in the world — sometimes demanding, as Arjuna finds in the Bhagavad Gita.
In Buddhism, the Dharma (capitalized) is the Buddha’s teaching; a dharma (lowercase) is a momentary element of experience. In either case, dharma points toward things-as-they-are and one’s accurate response to them.
To walk in dharma is to move with, not against, the grain of reality.