Well, from what can be seen on this unbiased review
, it seems to me that the Nikon D40 is far superior to the Canon 400D, in image quality, when both are used with their respective basic kit lenses.
If you want a DSRL that will get you started and will give you good results, go with the Nikon D40. It is a beginner's camera and it does have its limitations. It delivers what it promises, for a fair price.
The 6 megapixels are limiting, if you do a crop to about half the size of the original photo: the quality of the print you get out of it will noticeably decrease.
Also, there are no dedicated buttons for some settings, which means a little extra time to set those up. But there is a custom button that you can program to any particular setting you like to change more often.