Just a note, warforged aren’t machines. In 5e terms they are humanoids, but even previously they we beings of living wood with sap and such, and didn’t follow personality programming any more than a human.
So, if a DM decides they can be physically stimulated, they can. Certainly they feel pain. Easiest way to feel pain is just to feel contact, pressure, etc, at a fairly sensitive level.
And it’s pretty clear they can form emotional bonds.
So, really, it’s just a matter of...would you want to have sex with a tree person? How likely is that to be pleasant? But I mean, people are into weirder stuff, so
