Pakistan is a signatory to the Vienna Convention on Diplomatic Relations and the Vienna Convention on Consular Relations. The substance of both Conventions are part of Pakistani law through the Diplomatic & Consular Privileges Act 1972.
Under the Vienna Convention on Diplomatic Relations, a diplomatic agent cannot be arrested or detained. Period. No exceptions. The same for members of the technical and administrative staff of a diplomatic mission.
Many other countries in the world have adopted this convention and usually hold to the same. Whether an ethical consideration or no, such a convention is also to protect the lives and property of each nation’s own diplomats.