A 22LR ( Long Rifle ) rimfire is a great rifle for rabbits, but marginal for fox. It is commonly used with sub-sonic ammunition, this means the bullet is travelling slower than the speed of sound ( at about 1050 Feet Per Second ) and thus doesn't produce the "crack" by breaking the sound barrier. The slow speed of the subsonic bullet means the trajectory is pronounced and power is limited, so use it for rabbits up to about 70 yards ( with practice ). Power is measured in Foot Pounds Energy, a UK legal air rifle must produce less than 12fpe, the 22LR with subsonic ammunition produces about 100fpe. High velocity ammunition is also available which produces up to 200fpe, this would be more suitable for fox but only at close range.
The next step up is the 17HMR, this is also a rimfire so ammunition is quite cheap. The HMR bullet is smaller and lighter than the 22LR, but it travels a lot faster at about 2550 FPS and causes more damage. It's very humane on rabbits and useable on fox up to about 100yds. It's easier to use than the 22LR because the faster bullet has a flatter trajectory and is slightly less affected by wind. Many people will tell you that the small HMR bullet is blown around by the wind more than the 22LR bullet, but they are wrong. The HMR produces approx 275fpe.
A less common rimfire is the 22WMR ( Winchester Magnum Rimfire ). This fires a similar sized bullet to the 22LR, but a lot faster. The bullets are all faster than the speed of sound, so make quite a sonic crack. The trajectory is not as flat as the HMR, and is more affected by wind, however is makes typically 340fpe and will cleanly kill a fox at 100yds.
Rimfire rifles are great vermin rifles, the ammunition is relatively cheap, but the power is limited because the rimfire case cannot stand a lot of pressure.
If you want to get a rifle specifically for fox or for regular fox control then you need a centrefire rifle. The smallest calibre commonly used is the 22 Hornet, the ammunition can be bought and reloaded quite cheaply but in my opinion if you're going to get a centrefire for fox you may as well get one that will allow you to do so at longer range, so I reckon a 223 or better still a 22-250 is your best bet.
Of course none of these are worth squit if you can't hit the target and that means hitting a small area of the fox / rabbit that will ensure a humane kill. You can learn the basics of marksmanship with an air rifle, but perhaps a better idea would be to apply for membership of a rifle club. There is a statutory 6 month probationary period during which you will get to use a club rifle and benefit from loads of people who will teach you how to shoot. You don't actually have to join the club, you can apply for your FAC on a vermin condition, but you will definitely benefit from the tuition and advice in a safe environment.
If you decide not to pursue this route you can always join a shooting forum online, there will be no shortage of people who will be happy to kill your foxes for free if you allow them to take a few rabbits for the pot too.