Nightmares are sinister horse-like beings created out of blacksand -- originally Sandman's dreamsand corrupted and manipulated by Pitch.
Though they serve Pitch unwittingly yet efficiently for most of the time, they are not truly loyal to him, and will turn on him immediately. This is seen at the end of the movie, when they attack Pitch and drag him back into the shadows after he feels fear following his defeat. This, along with Pitch's statement earlier in the movie that they "smell fear", indicates that they are truly loyal only to fear itself and they will seek out and terrorize anyone who feels it.