Yes, and they're all characterized. It would be difficult, though; you're looking at about a half-dozen genes for the intermediary steps from something common like acetyl-coa.
But with just THC, it probably wouldn't mimic the effects of cannabis very well. There wouldn't be any CBD, terpenes, etc etc.
Still, you could do it. It'd probably be easiest with something like tobacco which is well-understood and already has a system for sequestering cytotoxins.
Doubt you'd get something with appreciable yield stably transfected before wider legalization hits, though. And that would be some expensive pot.