Why Dharma(धर्म) is pronounced as Dhamma in Buddhism? First for all I know that the correct Sanskrit word is धर्म (pronounced as Dharma) same goes with Nibbana (Nirvana, निर्वाण in Sanskrit) as Siddharth was born in India.

So either Pali is just a local dialect as people in Nepal region are not able to pronounce R र.

Same goes with native English speaker they roll R, I mean when we say car in India our tongue vibrates, which doesn’t happen with Native english speaker.

Why do we use Dhamma instead of Dharma?
Dhamma is the pali version of the word- In the time of Buddha , there was a conscious decision to record the teachings in Pali rather than Sanskrit. As sanskrit was not accessible to all and created a division between those who has access to it and who were interested in higher knowledge, but Pali was a common tongue in the region. 

But it is to be understood that Dharma(be it sanskrit or pali) in the context of Buddhism means much more than mere Duties as the common usage in Sanskrit means.
Dhamma is the very body of Buddhas teachings which is said to be universal in truth.