Yes, any spy can steal technology after it has been idle in a foreign city at least one turn, and you have enough espionage points required against that civ. You can only steal technologies that they have and you lack. Furthermore, you cannot steal a technology that you do not have the pre-requisites for, either (but you should be able to steal the pre-requisite).
Note, different technologies cost different amounts of spy points. So if they have Theology available, it will look cheap to steal tech from them, but something like Robotics will cost a lot more. If you just traded for Theo, the ESP page might not be updated to reflect the cost for the more expensive techs that would now be the only ones available to you.
Also, make sure you highlight the correct leader on the espionage advisor page before concluding that you actually have enough esp points against that civ to steal a tech.