The answer is somewhere in the middle. To always avoid the low E string while strumming full out is nearly impossible (and there's also sympathetic vibration to consider), but you should try not to hit it on purpose. Muted or not, it will make a sound when you hit it and muddy up the chord a little (esp. audible when you're playing through an amp). The trick is to not let it interrupt a fluent strumming motion. Aim for steady improvement, not immediate perfection.
As for the D chord, that's a tricky one. Since the A ist part of the D chord, it's not that big a deal to hit the open 5th string. BUT that's not the D chord in root position anymore. It's a D chord in second inversion or D/A. And it does sound different from the root position. As I said: not a big deal, but imho you should try to learn to avoid the A string with chords with a 4th string root. You'll have to learn thatanyway, since not all of those chords contain an A and some can sound really horible if you play the A.
P.S. If your hands are big enough, you could actually reach over the neck and mute both 5th and 6th string with your thumb (insurance policy), but let's try for some strumming accurany first, okay?