Correct Answer:
C. Be punished under Pakistan Penal Code and can be tried in Pakistan
The principle of territorial jurisdiction dictates that a sovereign state has the authority to legislate and enforce laws within its borders. Therefore, if a foreigner commits an offense within Pakistan, they are subject to Pakistan's legal system. The correct answer is that they can be punished under Pakistan Penal Code and can be tried in Pakistan. This upholds the sovereignty of Pakistan's legal framework. Option A is incomplete as it omits the punishment aspect, while Option B is entirely false, as no person is exempt from the law for crimes committed on Pakistani soil.