It depends why you are asking the question.
As suggested, you will probably find a lot online about the parentage of all who held office.
I haven’t looked, but many are likely to have “trees” online, but like any other tree you would need to double check them all to ensure they are accurate. A lot of people like to connect their lineage to royalty so you might find some tenuous connections and wrong assumptions on some/many/all of them.
If there is a specific reason you are interested in a specific person, maybe you could concentrate your search on them, and just follow the usual pattern of research - same as you would for anyone.
To find the full parentage of all the US presidents through your own research I think would be a bit of a task, but if you are up to the challenge, good luck.