At times, during the course of the Harry Potter series, one would think that Dumbledore was meant to be Gandalf. Outwardly, they have similar appearances, and they both speak in the same wise and cryptic words. Both of them, at times, become benign characters, with Gandalf often disappearing and Dumbledore spending a lot of time in the background, both making appearances in the most dire of situations to save the heroes.
Upon further examination, you would have to almost consider the children from Harry Potter to be similar to the Halflings, and even Voldemort with Sauron. This would only further lend to the notion that the Dumbledore is an ode to Gandalf.
But, in the end, after all the comparisons have been made, it would have to be said that the two characters’ origins are quite different. Dumbledore is a powerful man, no doubt; but, Gandalf is not a man. He is a divine being. He is, essentially, magic incarnate, and simply took the form of a man in Middle-Earth, hence his return as a more powerful wizard in The Two Towers. He is immortal and was the orchestrator behind the War of the Ring. Dumbledore was a very powerful, highly knowledgeable–but very mortal–wizard who, while doing his share to be somewhat of a catalyst to the demise of Voldemort, did not possess the same powers of puppeteering as his literary predecessor. Not only that, Voldemort was nowhere near the dangerous and evil entity that Sauron was.
Ultimately, it would have to be said that Gandalf is the greater wizard.