In an Alternative Universe when everyone knew Jon was a Targaryen + the Targaryens still were sitting on the Iron Throne, who was in the first line to rule next? Jon or Daenerys?
Jon probably. Aerys was the king, Rhaegar was the crown prince so Rhaegar's son would come next in the line and since Aegon is dead, that puts Jon next in line for the throne. But Jon's claim could be weaker if Rhaegar and Lyanna weren't married.
So in short, Jon is the heir to the Iron Throne if Rhaegar and Lyanna were married. If not, then Jon is still a bastard with a weak claim and Daenerys has a stronger claim.
Jon would be next in line if his parents did marry or if he was legitimised by the king. A legitimate child comes before a sibling - siblings are only heirs if someone has no children/only bastards.