When you are asleep, sometimes you dream. Dreams are a little like a movie that plays in your head while you sleep. Sometimes dreams are very ordinary, sometimes they are exciting, and sometimes they are scary. Scary dreams are called nightmares. Often things happen in dreams that aren't possible in real life.
A nightmare is a bad dream. Nightmares can be extremely frightening, and make you wake up scared.
You might also use nightmare to describe a particularly bad event, for example "we had a nightmare vacation".