Answer: When planting next to a building, you do need to be cautious not to disturb any surface drainage patterns, which could result in flooding of your basement or other parts of your property. If you have concerns about the surface runoff and drainage patterns I would strongly suggest you consult with a landscaping professional who is trained in handling drainage and property grading.
Rain run-off from the roof can be a powerful force causing erosion in the garden, beating down plants, or flooding sections of it. As long as you can accommodate those issues (install a rain barrel or cistern to catch water and slow its flow, for instance), I would not be particularly concerned about the proximity to the building with one final exception, which is the sunlight. Most vegetables do best with full sun all day. You may need to carefully plan plant placement so sun-loving plants will receive the most light.
Good drainage usually refers to the soil's ability to allow water to pass through it. A soil that is moist yet well drained should hold moisture, but does not become water logged or soggy because it is also able to hold sufficient air. Most soils require the incorporation of ample amounts of organic matter such as compost, rotted leaves, or well aged stable manure and bedding in order to achieve this goal. Raised beds may also be useful if your native soil is poor or problematic. I suggest that you run some basic soil tests and see what type of soil you have to begin with. Your County Extension should be able to help you with the tests.
Finally, if you have concerns about the soil quality in terms of contaminants associated with the building, your County Extension should be able to suggest appropriate tests, or alert you to possible hazards.
Q&A Library Searching Tips