There are many people who had dreams from God in the Old Testament. Here are some examples:
Adam: In Genesis 2:21 Eve is created while Adam is asleep. The Bible says, the Lord caused Adam to fall asleep and then took out on of his ribs! “And the Lord God caused a deep sleep to fall upon Adam, and he slept: and he took one of his ribs, and closed up the flesh instead thereof.” (Genesis 2:21)
Abraham: When God promised Abraham a son he spoke to him in a vision “After these things the word of the Lord came unto Abram in a vision.” (Genesis 15:1). Afterwards Abraham fell into a deep sleep and God showed him more things about the future of his people. In the same dream the Lord made a covenant with Abraham promising to give him the land (Genesis 15:18). “And when the sun was going down, a deep sleep fell upon Abram;” Genesis 15: 12. God’s promise to the Jewish people happened through a dream!
Abimelech also had a dream in which God spoke to him directly and told him: “Indeed you are a dead man because of the woman whom you have taken, for she is a man’s wife.” (Genesis 20:3).
Jacob: In Genesis 28 we read the story of Jacob stopping in Bethel on his way to the house of Laban to take his wife. “And he dreamed, and behold a ladder set up on the earth, and the top of it reached to heaven: and behold the angels of God ascending and descending on it. And, behold, the Lord stood above it, and said, I am the Lord God of Abraham thy father, and the God of Isaac: the land whereon thou liest, to thee will I give it, and to thy seed;” God shows him a vision and promises him that he will return to this land and that the land was his. A great promise! When Jacob wakes up, he did not question whether the dream was from God. It says: “And Jacob awaked out of his sleep, and he said, Surely the Lord is in this place; and I knew it not.” He then sets the stone on which he had used as a pillow and anoints it with oil, saying this place was the house of the Lord, a place between heaven and earth (Genesis 28:11-22). Can you imagine doing that after a having a dream? Jacob knew without a doubt that this dream was from God and that it was a real promise.
Jacob and Laban: After many years of hard work for Laban, God showed Jacob in a dream a way to divide the flock and receive his own rightful portion. In the same dream God told Jacob that He was the God that had spoken in his dreams in Bethel and told him to return to the land. Jacob obeyed the God who spoke in his dreams and left. Later Laban came after him and also had a dream from God saying: “Take heed that thou speak not to Jacob either good or bad.” (Genesis 31:11-24).
Joseph: In the story of Joseph there are many dreams. Joseph had dreams about his own future and his family, the Pharaoh had dreams, and the Pharaoh’s butler and the baker had dreams. These were mainly prophetic dreams, in which God showed or warned about the future (Gen. 37-40).
Gideon: In Judges 7:13-15 we read the story of how Gibeon is encouraged about his coming victory over the Midianites by overhearing an enemy soldier speak about a dream he had. In this way, God encouraged Gideon by giving someone else a dream. “And it was so, when Gideon heard the telling of the dream, and the interpretation thereof, that he worshipped, and returned into the host of Israel, and said, Arise; for the Lord hath delivered into your hand the host of Midian.” Judges 7:15
Solomon: When Solomon became King he went to Gibeon and God appeared to him IN A DREAM (see 1 Kings 3:5, 2 Chron. 1:7). “In Gibeon the Lord appeared to Solomon in a dream by night: and God said, Ask what I shall give thee.” 1 Kings 3:5. While Solomon was sleeping God asked him “what shall I give thee”, and while he was still asleep Solomon answered God and said he wanted wisdom. Then God was pleased and gave him much more than he requested. Only after this entire conversation does the Bible say that Solomon woke up. “And Solomon awoke; and, behold, it was a dream” 1 kings 3:15. The Lord spoke again to Solomon after he had inaugurated the Temple. “And the Lord appeared to Solomon by night, and said unto him, I have heard thy prayer, and have chosen this place to myself for an house of sacrifice.” 2 Chron. 7:12.