It's worth noting that the books never give a concrete answer to whether or not people without Targaryen blood can ride dragons. Fire & Blood seems to imply that there may have been some dragon riders who were not Targaryen, although whether or not they had a bit of dragon blood in them is unknown.
Further, Dany basically knows nothing about dragons outside of what she has learned from raising three of them. She didn't even know what they ate when they first hatched. Basically everything she knows is information Viserys, who was an idiot and likely didn't know much more than her, told her, or things she has learned since the dragons hatched.
What Dany does know is that Jon has interacted with her dragons in the past (last season), and they seemed to take to him pretty instantly. Now, we know that it was likely because of Jon's blood, but that would have been the furthest thing from Dany's mind. What's obvious to us isn't necessarily obvious to the characters, but then we have access to so much more information, both from the show/books and from the supplemental material that Martin has written as well. The characters in the story have no access to much of this information.