We already have the ability to have sex with a variety of machines and to have sex in virtual environments (from telephone and text based sex to full blown virtual worlds with avatars). The real goal of most sexual interaction is not just orgasmic release, but a sense of an intimate connection with another being.
The same is true for an AI endowed robot. The key factor is enough intelligence (or even mimicked intelligence) to create a sense of intimacy and the medium becomes irrelevant. If an avatar in a virtual world exhibits personality traits and can maintain a conversation level interaction, it cannot be long before somebody will try sexual interaction with it. This raises the possibility of a new version of the Turing test, which was designed to test Artificial Intelligence by comparing AI conversational interaction to humans.
If you can’t tell whether you’re making love to an AI or human being, the AI should qualify as true intelligence.