Jon Snow and Daenerys Targaryen are relatives. Daenerys Targaryen is the daughter of Aerys Targaryen II and Rhaella Targaryen, and the sister of Rhaegar and Viserys Targaryen. Originally, Jon Snow was said to be Ned Stark’s bastard son, but if you read the books, you will have an inkling that Ned Stark was only protecting Jon Snow because of his promise to Lyanna.
Lyanna’s words before she died in the book (and even in the series) were: “Promise me, Ned.” In the series, it Bran Stark’s ability which showed the viewers how Rhaegar and Lyanna loved each other. Bran then went on to say that Rhaegar and Lyanna had a son named Aegon Targaryen a.k.a. Jon Snow. Now that Jon Snow was revealed as the son of Rhaegar Targaryan and Lyanna Stark, it made him a legitimate Targaryen and the nephew of Daenerys Targaryen.