Yes you can shoot a magpie with an airgun but you need to be a certain distance away from a public road before you can discharge an air gun. It is quite a distance iirc.
It is an offence to fire an air rifle pellet beyond the land where you have permission to shoot, unless the occupier of the neighbouring land has also given you permission.
It is also against the law, in England and Wales, to fire an air rifle within 50 feet of the centre of a highway if this results in someone being injured, interrupted or endangered. These offences could be committed, for example, when someone is shooting in their garden close to a road and the pellets ricochet onto the highway.
I've used an air rifle on several occasions to cull magpies. Best bet is to lay out some bait near to a place you can hide, a garden shed is ideal. Make sure that the target area is safe, i.e. any overshot will not leave your property/endanger anything else. Best bait is meat, a chicken carcass nailed to the floor is best.
Then hide and wait. Maggies are skitish at best of times, and wont appear if they think things are off. Wait till they land then take thenm with a head shot. If you're not confident of a head shot, then don't try, like all birds the chest area is dense muscle and feather, and a body shot with most non-firearm rated air-rifles is not a 100% quick kill.
If you get one, stay put. Quite often others will turn up to check the corpse.