Fox is really, really hard with Kirby.
Out of D-throw if you can get any follow-through, then it's a good thing. Kirby's tech chase game is, well, bad. Mostly because he's slow. One of Kirby's more painful flaws is that his throws are, well, terrible. U-tilt if he techs in place is good, generally (you may have to walk/wavedash to land this). Swallow is okay if they tech roll away from you and you expect a shield, shine or sidestep (sidestepping or shining is popular after tech rolls because they help escape predictable regrabs so swallow is a good mixup) but if you whiff Swallow then god help you. D-smash is somewhat of an unorthodox choice; I'm not sure how it works. I'm not sure if this works with Kirby but what Sheik can do out of D-throw is space and time an U-smash to cover 3/4 of Fox's tech roll options (not tech, tech in place, tech past) and Kirby's D-smash seems like it could do the same (I think it has more horizontal range than Sheik's U-smash) although I really have no idea if it would. If it did that would be worth investigating although my gut feeling is that it's too slow. But Kirby sometimes surprises me, so who knows.
Okay, that's a lot for D-throw.
For countering sidesteps... just don't be so obvious I guess? Bait it and punish? There's not much to sidestep counters with Kirby. Other than Swallow, maybe repeated U-tilt spam, and/or Rapid Jab you don't really have anything that covers sidestep (Sheik has D-smash, for instance, IC have blizzard and D-smash if you do it with tricks, Fox has... well, everything he does covers sidestep lol, etc) and the few things you do have are for the most part horrifically punishable (especially Swallow; whiffing Swallow is like surrendering 30% or a stock). If it's a really bad sidestep like Mewtwo's you can just punish it but... for fast sidesteps like Fox's or Sheik's it's pretty much you have to space as best you can so you can't be horribly beaten to death if you do whiff on their sidestep and from there just try to catch them. Kirby's jab isn't bad so consider it an option in close range (it sounds like close range) but... jabbing vs Fox in general is risky (unless you're spaced and Sheik/Marth). CC shine is horrific.
You asked about the fence of pain. The fence of pain, honestly, is mainly setup by Bair. On-stage there's not a whole lot of combo power Kirby has. The most elaborate combo I've ever done with him is U-tilt weak Nair U-tilt Bair around 30 or 40ish against my friend's DK and after that Bair it ended completely because he DIed away. Kirby's combo power is horrible. To setup fence of pain, you need them off the stage pretty much because there's no hope of setting it up onstage so mostly just B-air, kick them off and then fence. On that note, U-tilt sets up B-air very nicely so that is also a recommended option to setup the fence.
To get around a bad Fox just U-tilt a lot and grab him a lot and Bair him a lot. Also, spacing. And shield-grabbing. Sit in shield. If he comes at you with grabs, WD back into a defensive tilt. If he comes at from the air, shield grab him. This will stop working when he stops sucking. At which point, your strategy changes from punishing and spacing to "Praying". Actually it doesn't really change but it becomes absurdly hard. It's very hard to punish a spaced Fox with Kirby especially the ones that like to run back and forth into grab and U-throw Bair/U-air.
For now, though, stick to shield grabbing and spacing his approaches and if he can't WD out of shield or U-smash out of shield, you can probably get away with approaching with spaced F-air. And, of course, Kirby's staples (grab, u-tilt, bair, and kind of f/d-tilt).
I'm confused by what you mean for YLink. Do you mean recovering? Or when you're at the ledge he times it to hit you out of whatever you do? Whatever, I'll answer both.
YLink is a cunt in general. At the ledge just play around with the edge. You have five jumps. Five horrible, low distance jumps, but you still have them. So just drop low and regrab the edge, fake returning to the stage by jumping back and then jumping forward with Bair or something. Just play around. Don't roll to get onto the stage, Kirby's roll is terrible. Ledgedashing or ledgehopping onto the stage quickly and throwing up a shield is also okay. You have to do it fast to preserve invincibility and there will be a gap of invincibility between the shield and you leaving the edge but it's a small gap if you do it right so try it and consider it. You can, obviously, just do the standard getup or ledgehop a fair or bair or whatever but... Kirby is punishable just about everywhere the ledge is no exception. Just be patient, and very careful, and you should be okay but sometimes you will get hit if they just outsmart you. That's really all there is to it. Kirby on the ledge is bad for Kirby. You can ledgehop Swallow for lolz/mindgames but that probably won't work against spaced people. If you can use it to scare people from being near you at the ledge, then that's awesome, and makes life easier... but if they're smart it won't work.
If he's edgeguarding with Dair and you mess up your Final Cutter squeezing/sweetspotting just DI it and you go straight up. From there just stone and sweetspot the stone or recover from high up accordingly. Or move out of his way. Or get close to the top of the stage and if he does it air-dodge through it. If you're at killing percent you're pretty much screwed if they time it perfectly and wait for you and have a way of hitting it, but unless you're at 80ish don't worry too much about it. I'd be far more concerned with D-smash, ledge hopped Nair, and a whole bunch of other stuff.