As far as Targaryen loyalists are concerned, Daenerys was the rightful and trueborn Queen of the Andals, the Rhoynar and the Firstmen by birthright, she didn't need to sit on the throne to be that. She became Princess of Dragonstone (Heir apparent) the moment she was born and became the head of the Targaryen dynasty and the Queen when her brother Viserys third of his name died. Of course, by primogeniture, the de-facto law of Targaryen inheritance, Jon was the King by birthright. But Jon didn't know that, nobody did, so in absence of a male claimant, Daenerys claimed that right by both primogeniture and proximity.
Later, Jon Snow had sworn fealty to Daenerys so even that obstacle was removed from her path. She was well within her rights when she legitimised Gendry. At least as far as Targaryen loyalists are concerned, which at that time, Gendry was. All the people who assembled at the Great Council were effectively Targaryen sworn bannermen at that point.