I love my .17 HMR and if I were going to be going after fox my go-to gun would be my Marlin 917V .17 HMR. I might prefer a slightly lighter .17 for going after fox but there are not a lot of squirrels that get away after I get them in my sights.
I don't think it would leave an exit wound but do I think it would kill one very efficiently.
But a good .22 LR round would probably do the job. The difference I notice between shooting squirrel with good .22 LR and .17 HMR is that squirrels hit with the .17 HMR are dead on impact, .22LR they roll around take a little while to die, some get away. A bigger animal like a Fox, perfect shot placement is going to be necessary.