It will work, but don't fool yourself....
I grew up with an M1 carbine as the family truck/house gun....it was the rifle that was always around, because it was HANDY. It went everywhere with dad and I. It was my first centerfire rifle that was mine....
And while it was really fun to shoot[we always seemed to have a ammo can full o'ball handy] and to a 8 year old, it look really kewl, I quickly learned that I had to shoot animals several times to have much effect. I'm not talking bull elephants, I mean run of the mill stuff that needed killing around the country side. Feral dogs, 'coons, bobcats, etc. When you got to wild pigs, and I don't mean big boars, but just 30-60 lbs shoats, I would need to put sometimes 3-5[!] rounds into the chest cavity do slow them down much. When they got much over 100 lbs, we are still talking pigs folks, not big "wild boars" like most envision, I would have to shoot them to pieces to anchor them. Yup, I'm talking soft point/hollowpt hunting ammo, not ball.
BTW, post-mortem investigation showed that the soft points didn't expand much, and didn't perform overall much better than ball.
Dad only let me shoot 1 deer with it, and after that multi-shot fiasco [first shot was right through the heart lung area, and the rest peppered around the body as I tried to stop the wounded animal form escaping to die a slow death] and subsequest blood trailing session[ we found the young buck, but it took awhile]. Dad upgraded my hunting armament to a single shot 30/30 with a weaver 3x that killed things alot better.
Now I'm not saying you need a single shot 30/30 for home defense, but don't fool yourself into thinking you have a semi-auto death ray! Look into the current crop of ammo, and see if anything has improved much......surely somebody has something better now than I had in the '70's[ ok, I'm feeling old now]. Make sure your rifle works well with your mags.....I found that the mil surp 15 rounders worked much better than most 30 rounders. I remember going through 3-4 aftermarket 5 round hunting mags to get one to work well. Looking at my old carbine, I think that if I were to set it up now for a HD rifle, I would open up the rear peep site a little....make it a little more of a "ghost ring" instead of the relatively small aperture. You can probally find a surplus site to experiment with. If your rifle is a milsurp, Olde but Goodie, check your stock.....mine was knocked over a few years ago, and took a fall. The stock broke cleanly in half behind the trigger guard. I replaced it with a wood surplus stock, but I think that if I were going to use this rifle more seriously, I would look into a synthetic stock from Choate or some such maker.
M1 carbine is a really neat rifle, that is most of all, VERY HANDY. Its fun to shoot, lite weight, low recoil and easy to teach newbies to handle. Great for kids with the proper training. An old former WW2 sergeant told me that is why lieutenants liked them so much....and the sergeants kept their Thompsons