Carl Jung had a theory that every man and woman has an animus or anima. An animus is the male energy of a female and the anima is female energy of a male. Sex with a stranger of the opposite sex has to do with the state of your animus/anima. It's about balance, about merger of the male and female aspects of yourself. And actually, sex with a stranger in a dream, given that it is not scary or traumatic, can be quite a fortuitous sign of personal growth.
I had this dream once where I had sex with a man who was "my angel" (that's how he referred to himself in my dream). When I asked his name, he told me it was "Anger." When I thought about it, it was a really cool dream. It was about me accepting my anger as a necessary part of myself.
It's also interesting to take note of what kinds of strangers you are having sex with in your dreams. I've noticed that over the years my strange men have evolved from being gimpy, brutish or crippled to being strong, sweet and wonderful. These strange men will let you know what state your animus is in. For example, if your animus man is always under-evolved in some way, it means you need to work on strengthening your masculine aspects. If your animus is a big, strong, overpowering type, you may need to work on nurturing your femininity.