Coconut oil could be used a lubricant when having intercourse but I wouldn't recommend it.
Coconut oil could mess up a women's PH balance in their Vagina and cause a yeast infection.
Also coconut oil would not be safe for condoms either.
I'm not sure about using coconut oil to masturbate with on your penis but it's probably safe and worth a try.