You should be able to sponsor your friend to visit the UK but there are many rules and conditions that you both need to meet. Here's a summary of what you need to know:
- By sponsoring him/her you are saying that you are willing for them to stay with you and that you will support them financially while they are here.
- You would have to supply bank details and wage slips to provide evidence that you can support them and evidence of your own immigration status within the UK.
- Most importantly, your friend would have to show that he has a good reason to return to Pakistan - either a good job, or he is a high profile student, family commitments etc. This is just to prove that he will return and won't stay illegally in the UK.
You can find more information here