Frank Baum left that to your imagination. His purpose was to tell a tale that may, or may not, have happened in fact, making it plausible enough for a child's fantasy to take as real in some sense. His concern was not with more highly trained, externally oriented, rational adults, though his work has found wide popularity among them, too. He succeeded in spades.
Ye it was a dream. When Dorothy wakes up she sees that all of her neighbors resemble the characters she (dreamed) about. Only in one's imagination could a place like the land of Oz exist. One man's opinion! :-)
In the movie it was a dream, but I think in the books it was real. I read I think 4-5 books but I heard that in a later book Uncle Henry, Aunt Em and she went back to Oz to live there. Maube that was the original Narnia.