You can't implement a direct copy of the D&D rule set, there are however, open rule sets that have been created with the express purpose of being copied and modified for your own use. You can build a game system based on one of these free rule sets, or you can make your own.

You can check out [Draft][1], it's a free RPG rule set. 


  [1]: http://ekkaia.org/rpg/draft/ "Draft"