If you're able to somehow gain control of an enemy's body (telekinesis, possession, etc) could you actually cause them to hit themselves with a weapon (or an unarmed attack) to cause damage? If after they hit themselves, would you still be able to control the enemy's body?
But that depends on the effect that you used to obtain this control.
Possession and Magic Jar clearly states that you gain (nearly) full control of the target's body, you simply cannot use many of her special abilities. Aparently the knowledge of special abilities are within a person's mind, but you can use their claws and similar natural weapons.
Now, for Dominate Person and similar spells, the spell effect says the target cannot obey self-destructive commands, and thus, wouldn't be able to hurt itself unless attacking himself is not a self-destructive action (like the creature being a masochist, maybe...)
Telekinesis, however, does not allow control of the target's body in any shape or form, it allows specific actions described on the spell effect. You can hurl them around, drop them on the ground, disarm or hold them against a wall, but you have no control of their body.
Can a controlled opponent hit itself ?
It really depend on the kind of control. Some permit self-destructive acts, some doesn't, some just allow a new save. See for example ShadowKras' answer for more details.
How to solve the "hit itself" action ?
RAW: the normal attacking rules don't work to hit yourself
The rules state about attack that:
With a normal melee weapon, you can strike any opponent within 5 feet.
So apparently the combat rules only stand for attacking opponents. You can't be your own opponent unless you are really crazy.
Now let's suppose you are the DM and a player just told you "I hit myself with my sword". You can't simply tell him "you can't, rules don't provide the rule for it" ! You have to make up something.
You can state that the attack is an automatic success and deal the usual damages. However this ruling don't take account about the fact stabbing yourself is really different from actually performing an attack. You can kill yourself with a sharp pen if you stick it in the right place, but you will have a hard time power-attacking yourself with a greataxe.
Personally I would follow the same rules as for the confused condition: deal 1D8+Str damages to yourself. It can seem weak: it means you will have a hard time making a dominated person stab himself to death, but it encourages creative ways to make enemies commit suicide. After all a body has reflex reactions that tend to make difficult to perform such actions.