Well it is my perception that what you think the whole day, it results as a dream in our mind at night. So, may be you are thinking about your dog,and it comes as a result in your dream.
I believe that dreams are the result of your brain storing information while you sleep. Some how, info collides and and crosses paths with other info heading in a different location. Which leads you to weird dreams like your teacher playin jax in the backyard with johnny dep as edward scissor hands... Don't worry to much, I doubt dreams mean anything. Your mind is pretty powerful.
I don't want you to think that this is some sort of premonition, it might be that you are afraid of losing him. I don't know how old he is, but you shouldn't panic over that. Hope this helps.
Well, nightmares happen when you treat a thing badly. For example, you treat your dog badly. So your brain gives you signals called nightmares to treat your dog well. So, it means that you must treat your dog better than before.