According to Buddha's characteristics and teaching in Pali Canon, could he have taught Vajrayana (and Karmamudra)? One of the characteristics of Vajrayana is its secret transmission (esoteric tranmission) of certain teachings. The other one is the controversial   karmamudra (sexual practice to reach spiritual attainment).

So the question is, according to the characteristics and teaching of Buddha in Pali Canon, could he have taught Vajrayana and karmamudra?
According to the early texts the Buddha didn't have any secret teachings. Somewhere in the Digha Nikaya (I think it's in the Mahaparinibbana Sutta, but it's a very long Sutta and I can't quite locate it) the Buddha said: "I do not have the closed fist of the teacher who holds anything back" and in AN 1.283 the Buddha said: "Three things shine openly, not in secret. What three? The orb of the moon, the orb of the sun and the Dhamma and discipline taught by the Tathàgata"

One thing to note though is that the Tantras mostly don't claim to have been spoken by the historical Buddha Sidhartha Gautama, or Shakyamuni Buddha, but by Vajradhara, a different Buddha that is often understood to be Shakyamuni appearing in Tantric form. They say that Vajradhara appeared to the various Mahasiddhas in visions and revealed to them the various Tantras that became the basis of the tantric teachings.

Also, just to clarify for readers who may not be aware, Karmamudra is a high level tantric practice in which one engages in sexual intercourse with a special consort in order to destroy the knots around the Heart Chakra and thus allow the attainment of enlightenment. It is a very high level practice and isn't done lightly. Monks are not allowed to do it (at least in the Gelugpa school) because of their vows of celibacy. It's a very rare practice.