Maybe something happened during your day that has an association with that person. This often happens to me with my parents. it may be something you didn't really notice, but your subconscious mind will pick up on it. dreams are the brain's way of trying to make sense of the things that happen to us during the day. There's nothing sinister about it, I often have a few different things going on that work together in very strange dreams!
It depends on the type of dream you have. If it is centered around your loved one and is filled with powerful emotions of love and longing, then it could be your loved one visiting you from the other side. This is the easiest way for our deceased love ones to contact us. If you cry during the dream, then you can be assured that is what is happening. It is truly a gift for them to appear in a dream state.