Sure, any behavior is going to be a product of evolution and environment. Of course, sex is actually the mechanism of evolution, so it's doubtful that pretending behaviors associated with it are not strongly related to it will yield sensible results.