There seem to be plenty of testimonials around that Morpheus in The Matrix was partially inspired by Neil Gaiman's Sandman, who also went by the name Morpheus, being (among other things) also the entity that the ancient Greeks knew as the god Morpheus in-universe; here is an excerpt from The Matrix Decoded: Trivia, Curious Facts And Behind The Scenes Secrets (Google books):
Lawrence Fishburne relied on Neil Gaiman's Sandman comics' character to play Morpheus, at the request of the Watchowski sisters
and a recent (September 2019) article in Business Insider, among others:
The Wachowskis reportedly asked Fishburne to draw inspiration for his performance from the character Morpheus who appears in Neil Gaiman’s comics “Sandman,” according to Gaiman’s blog.
Truth is, all these indirect testimonies seem to be based upon a single source, which is not the movie creators or the cast: it is Gaiman himself, as quoted from his blog in the other answer here by Valorum; and especially since this excerpt has been included both in the Matrix Fandom wiki and Wikipedia, I suspect it has become something of a ground truth, and everyone feels comfortable to quote it and use it as evidence. One may expect that, more than 20 years after, either someone would have been able to unearth this sole reference Gaiman talks about in his blog, or Fishburne (a great comics fan) would have repeated the claim somewhere, but nothing of these seems to have happened so far.
This is not to say that an influence of Gaiman and Sandman on the Wachowskis and The Matrix is unlikely. Quite the contrary: The Sandman was a monumental piece of work, and its influence was arguably at its peak during the conception of The Matrix; and Gaiman was later a contributing writer in The Matrix Comics with "Goliath", which was initially written as a short story for the whatisthematrix website even before the movie was released:
After The Matrix was filmed, but before it was released, Warners set up the whatisthematrix website and put comics and short stories up by various people to help promote it. I was one of the people. They sent me the script and some photocopied storyboards, and I read it and wrote "Goliath", which they then put up on their website, to help promote the film
Source: Neil Gaiman's blog, May 2003
so IMO, and despite the lack of direct evidence, Gaiman's claim sounds convincing indeed.
In any case, this answer is arguably not very enlightening; it simply moves the question from Morpheus of the Greek mythology to Gaiman's Sandman/Morpheus, which is actually based on the former...
I guess a satisfactory positive answer should focus on the relation of the movie's Morpheus to actual dreaming, which again is not that straightforward: Morpheus the character actually awakens people from something that resembles a collective dream, bringing them back to reality; not exactly what we may expect from the god of dreams and/or Sandman - but here is a fan theory from the Sandman page in TV Tropes:
Hundreds of years in the future, Morpheus helps lead a rebellion against Machines
When the Machines enslave mankind and trap all humans in the Matrix, it robs them of their ability to dream spontaneously on their own. This, in turn, greatly weakens Morpheus and causes the Dreaming to break down. To stop the Machines, Morpheus takes human form and helps free the one man in the Matrix who he knows can topple the Machines: Neo.This is why Morpheus' digital avatar always wears sunglasses—he's unconsciously mimicking the formless black eyes that he has in his true form. And this is why he comes off as distant and all-knowing, and why he insists on believing the prophecies about the One that other leaders in the Rebellion dismiss as superstition—he is one of the Endless, and has an innate knowledge of things that humans can only speculate about.
And here is something more down to Earth - Morpheus's own references to dreams in the movies - which may be helpful:
Random Trivia: “Morpheus” in The Matrix was loosely based on “Morpheus” from The Sandman comics, who is supposed to be the Greek god of dreams. As such, many of his most important lines through all three of the films are dream-related, such as one of his final lines in The Matrix: Reloaded (“I have dreamed a dream, but now that dream is gone from me,” said after his ship is destroyed) and in The Matrix: Revolutions (“Is this real?” said after the Sentinels stopped attacking and the war ended).
... or again, they may be not: Sandman/Morpheus himself does not dream, and we could never imagine him wondering Is this real?