From what I can tell, yes and no.
The big NO is that you can't have a code and
free dining on the same package - Disney does not allow "stacking" of promotional deals. So, if you got the 40% code going around now and book a vacation for September (the most likely month for free dining if its offered again) you cannot ADD the free dining to your vacation. If the Free dining saved you more than the 40% (possible if staying at a Value Resort), you could change your ressie and drop the 40%.
Here, however, is how you can use both - sort of.
IF your vacation includes "travel" days - the day you check in and the day you check out, where you aren't going to the parks and will eat little (if anything) onsite, then do this.
Book a "Free Dining" vacation only for your FULL days at Disney.
Book a "Room Only" ressie for your arrival day and departure day at the best discount you can get. It will require you to do a couple of checkouts and checkins, but calculate how much you can save and see if it's worth doing.