Why is there no reason, to use your example, to record the number of people from Poland in Peterborough, yet there apparently is a reason to record the number of people in Peterborough whose ethnic group is Pakistani?
Possibly because 'ethnicity' often transcends generations, whereas 'nationality' generally doesn't?
For example, the grandchild of someone who came to the UK from Pakistan might regard their ethnicity as 'Asian' or 'Pakistani', whereas the grandchild of a Polish airman, who remained in this country after WWII, wouldn't regard themself as 'Polish'.