In fanfiction, it could be due to a strange encounter with a magical or ancient artifact. This artifact has the power to transfer the Sharingan's essence from Madara to Naruto. It might be a relic from an ancient battle between the Uchiha and some other powerful force, and when Naruto and Madara come into contact with it, the transfer occurs.
In fanfiction, Naruto could get the Sharingan through a blood - related connection that is revealed later. For example, it could be discovered that he has some distant Uchiha ancestry that gets activated somehow. Maybe a powerful enemy's attack awakens this dormant Uchiha blood in him, and as a result, he develops the Sharingan. It could also be that a powerful sage or a new character uses their own unique powers to bestow the Sharingan upon Naruto for a specific purpose.
In some fan theories, it could be due to a unique chakra interaction. Maybe the Kyuubi's powerful chakra somehow mutates Naruto's own ocular abilities and triggers the emergence of the Sharingan. But this is just a wild fanfiction idea.
In a fanfiction, Naruto might obtain the Rinnegan and Sharingan through a unique encounter. For example, he could stumble upon a dying Uchiha who transfers his Sharingan to Naruto in a moment of desperation. As for the Rinnegan, it could be related to his connection with the Sage of Six Paths. Perhaps the Sage's spirit, seeing the great need in the ninja world, bestows the Rinnegan upon Naruto. It could also be a result of some sort of genetic experimentation gone wrong but in a way that gives him these powerful eyes instead of harming him.
In some fanfictions, it could be through a divine intervention by Kami. Maybe Kami sees Naruto's pure heart and his need for more power to protect the village. So, Kami decides to bestow upon Naruto the power of Madara's Sharingan as a way to give him an edge in battles against powerful foes.
Perhaps in the fanfiction, there is a forbidden scroll that Naruto stumbles upon during the Chunin Exams. This scroll contains a secret technique that allows for the transfer of the Sharingan. Naruto, being the curious and fearless character he is, tries it out and ends up with the Sharingan. Another possibility is that there is a spirit or a deity that decides to bestow the Sharingan upon Naruto for some greater purpose that is related to the events of the Chunin Exams.
In some fanfictions, it could be through a special jutsu or ritual. Maybe Itachi, before his death, transferred his Sharingan to Naruto in a unique way, perhaps using a forbidden technique that was known only to a few in the Uchiha clan.
In some fanfictions, it could be through a strange and powerful jutsu transfer. Maybe Madara, on the verge of defeat, decides to transfer his Rinnegan power to Naruto for some unforeseen reason, like seeing a new path for the ninja world in Naruto.
In fanfiction, Naruto could obtain the Golden Sharingan through a powerful ninja ritual. Maybe a sage or an ancient ninja figure passes on the power to him as a last resort to save the ninja world from a great evil. For example, if there's a threat that only the combined powers of the Uzumaki and Uchiha clans can defeat.
One possible fanfiction could be about a young ninja who discovers he has a special connection to Madara's Sharingan. Maybe he inherits some of Madara's latent powers through a mysterious family link. This could lead to him being hunted by those who want to use his power for evil or by those who fear it.
One possible thing that could happen is Naruto would gain new visual abilities. With the Sharingan, he might be able to copy jutsus even more effectively than before. The Sharingan could also potentially enhance his perception of his opponents' moves, making him an even more formidable fighter in battle. This could change the power dynamics in the Naruto universe significantly.