Having unprotected sex is always a risk for HIV. Is this someone you know? Do you know their status? Having genital herpes does also increase the odds ever so slightly of transmission. Most folks, if they have a single unprotected sexual encounter of vaginal or anal penetration, there is less than 1 percent chance of transmission. Here's a study talking about why HSV-2 would increase the transmission rate of HIV. https://www.nih.gov/news-events/nih-research-matters/why-genital-herpes-boosts-risk-hiv-infection. But the important thing to know is that it is still a very low occurrence. Wearing a condom unless in a monogamous relationship with someone in which both of you have tested is the best way to protect yourself.
Don't understand your question. If you don't want to get HIV, don't have unprotected sex with someone you're not married to and trying to have a child with. Remember, pregnancy can also occur assuming you're heterosexual, but again, if you're going to have penetrative sex use protection and then you don't need to ask hypotheticals.