When I strum up on chords like Dm I keep hitting the strings that aren't suppose to be played. In the last few days I've practiced and am getting better at not hitting them, but I was just wondering does it mater. I just started learning guitar and don't use a pick.
You can answer this question yourself, by listening to the sounds you are making.
What sound does it make when you hit the strings "that aren't supposed to be played"? Is it a sound you like? Do you want your audience to hear it?
Making music isn't just a matter of making the mechanical movements written on a transcription. It's very important to listen, and adjust to make the sound you want to hear.
Yes, it absolutely matters. The other notes are not played because they're not part of the chord. If you play them, you're no longer playing a Dm, and it will sound incorrect — and potentially horrible. A C Major chord where you hit the low E isn't the worst, since E is part of the chord, but a Dm featuring the low E would be quite awful.
If you're just strumming chords, you should probably start learning with a pick as well. It can make things much easier and cleaner. Strumming with your nails will be quite tough on them and require more control. (And if you don't have nails, chances are you will be very inaccurate and the tone will be poor.)
For learning a versatile technique, it's good to hone your picking accuracy. But I echo slim's advice that you should always let your ear be the judge rather than any "rules".
For avoiding the low E string on the up-stroke of a D chord -- the A is part of the chord, so it's fine: it just makes an inversion rather than a root-position chord -- you can work on the angle of your strum, so that you just miss the string. Another way is to drag across the strings and stop against the E string itself.
Another thing you can do, possibly in combination with the above, is muting the unwanting string. You could stretch your pinky up and touch it or wrap the thumb over the top. Or, since your strumming with your fingers, you could mute it with your thumb and strum that chord with just finger motion.
It'll take some experimenting to find a way that works for you.