If you are traveling and not staying in your own country and would like to take a visa to Pakistan, then you can definitely do so but it can only be approved if you are a permanent resident in that particular country. If this condition has not been followed then you might not be able to get the visa issued to you.