One way could be through a series of intense and life - changing adventures. He might encounter different clans that are willing to share their dojutsu secrets with him in return for his help in protecting their clans or achieving some common goals. Also, his Uzumaki heritage could be a factor. The Uzumaki are known for their strong life force and unique chakra. It could be that this heritage combines with some other factors in the fanfiction world, like exposure to certain types of chakra or a special training regime, that eventually leads to him having all dojutsu.
Well, it could be due to some powerful entity's intervention. For example, a god - like being from the Naruto universe might take a liking to Naruto and grant him all the dojutsu. This being could see Naruto's potential and his pure heart and decide that he is the worthy one to possess such power. Another possibility is that Naruto's own chakra, which is extremely powerful and unique, somehow mutates or evolves to give him all the dojutsu. His strong will and determination might also play a role in this transformation.
In some fanfictions, Naruto might obtain all dojutsu through some kind of ancient inheritance. Maybe he discovers a long - lost scroll or a hidden temple that bestows upon him these powerful eye techniques.