There is no dramatic irony in the pit and the pendulum but there is situational irony.
Not knowing the story or excerpt you are referring to, I can only help you by asking some questions to get you thinking about the correct answer. Is the village far away from other villages or towns? Are there many sick people in the village making the doctor want to stay away? Is there a lot of violence that the doctor is trying to avoid? What is it about the village or the people in it that the doctor would be trying to avoid? The answer to that questions is the answer to your question.