It's extremely rare, if not unheard of, for a person to possess both a penis and a vagina, if only because both anatomical structures develop from the same tissue in utero. More likely would be some combination of an enlarged clitoris or small penis and a shallow vaginal canal or vaginal opening. However, it IS possible for a person to possess other sex traits that are female- or male-typical, such as labial folds, scrotum, and internal and external gonads (like ovaries and testicles). Hermaphrodites only exist in legend, not in reality. Intersex people, however, are real and more common than most people think.
Re. transgender: this arises from a conflict between a person's sexual anatomy and sex assignment at birth (their sex) and their subjective sense of being a woman or a man (their gender identity). Intersex and transgender experiences are different.
There are lots of resources on the internet to help you refine your understanding of these different types of humans. The Intersex Society of North America is a good place to start: https://isna.org/. On transgender people, Julia Serano's webpage is a great resource: https://juliaserano.com/