No, "thwart" has a connotation of because one is an adversary.
"From" is wrong in this context.
You prevent an action from happening. "We were prevented from accessing the building during the safety drill."
You prevent a thing. "We were prevented access to the building during the safety drill."
- For Teachers