Dasanayake was educated at the Royal College Colombo and at the University of Colombo, where he gained a LLB. Taking oaths as an attorney-at-law, he worked in the Foreign Employment Bureau before becoming a State Counsel in the Attorney-General's Department in 1989.
In 1994, he was appointed as the Assistant Secretary General of Parliament and was made Deputy Secretary General of Parliament in 2003. During this time he held many positions in the Commonwealth Parliamentary Association, Inter parliamentary Union and functioned as an advisor for United Nations Development Programme projects. Dasanayake has served as an advisor on parliamentary matters to the United Nations Assistance Mission in Afghanistan. Dhammika is the son of D.M.P.B.Dasanayake, who served as Permanent Secretary to the Ministries of Education, Labour & Budhasasana.