The license to D&D includes everything, it includes the setting, characters, stories and games themselves. It will be clear from the articles I link below.
Back in the time of original BG, Interplay had all the rights, then lost them to Atari (
http://interplay.wikia.com/wiki/Inte...ragons_License), then Hasbro got all the rights from Atari (
http://www.escapistmagazine.com/news...winter-Delayed).
Beamdog doesn't have this IP, all they have is a license to work on BG and to add new content, and to disrtibute the EEs through their own store. Hasbro/WotC decide on distribution ways of the original games and can influence distribution ways of the EEs.
GoG.com got exactly those rights to distribute the original games and the EEs the rightholder (Hasbro/WotC) decided to give them.