I am sure we have had presidents who were born to unwed parents. But if you mean something different, then it makes sense.
If Obama Sr. was indeed married to his wife Kezia in Kenya in January 1957, following which their son Roy was born in 1958, then Obama Sr.'s marriage to Ann was bigamous and void under Hawaii law. That would make Obama Jr. illegitimate.
Obviously, these circumstances were entirely outside the control of Obama Jr.
I am not sure there is any other president as to which there has even been an issue of illegitimacy, including Bill Clinton. With the exception of Obama, historians and biographers have gone exhaustively through the background of all of our presidents. Is there some president in particular you were thinking of?
No. I was just speculating.
See it did make sense. Thanks.