DTD is located right next to the Esplanade, which is the main entrance/exits to DL and DCA.
However, consider that DTD is a long strip of land, so if you are talking about a restaurant at the other end, it is a walk (or you can take the monorail, if you are in DL to get to the other end).
To get from the esplanade to the other end of DTD is about a 10-15 minute walk.
To get from the esplanade to where you want to go in the park, could be anywhere from less than 5 minutes to 15 minutes.
Taking the monorail from DL can be a time save, if you are near that area (near autopia in tomorrowland), but it would still be at least a 5 minute trip depending on waiting for the next monorail.
So it can be done, but you are likely going to be losing 30 minutes to an hour getting to your destination and back on average. Of course, if you were going to go "earl of sandwich" which is right outside the gates (until they get rid of it at that location), then you would lose only a small amount of time if you were close the entrance of the parks.
If you are in DCA, you can consider going to the GCH hotel restaurants, as well.
Getting back into the park (either one) after park opening during the day or evening is usually not difficult (less than 5 minutes), unless you are going when park hopping starts, or there is a special event going on that is starting at that time.