Despite similarities, the two works differ greatly. Dune is set in a distant, futuristic universe where humanity has scattered across the stars and is ruled over by an emperor. The narrative is focused on the political struggle for control of the planet Arrakis, also known as Dune, and the destiny of the Atreides family, with Paul as the central character experiencing profound visions of the future. The world of Dune is incredibly rich, with an intricate political backdrop, diverse characters and a complex web of religious and ecological themes.
In contrast, The Teachings of Don Juan is a largely autobiographical account of Castaneda's experiences meeting with a Yaqui shaman, Don Juan Matus, and his introduction to shamanism and the philosophical teachings Don Juan imparts to him. The narrative focuses on their relationship and the narrator's personal journey of learning and self-discovery, rather than being caught up in a galaxy-wide political struggle. While the book does touch on the spiritual and the mysterious, with the narrator experiencing altered states of consciousness induced by peyote, it is more grounded and relatable than Dune.
So, while both books contain some similar elements, they differ in terms of their themes, focus and the worlds they portray. As for the question of success, this is a matter of perspective. Paul Atreides succeeds in fulfilling his destiny, becoming the Messiah and gaining control of the Empire. The narrator of The Teachings of Don Juan also appears to succeed in his goal of learning about shamanism, completing his apprenticeship under Don Juan.