Lots of good info, bad info, and ugly info thrown about in this here thread.
If it's ALL you had, Certainly use your AK-74 / 5.45 cal rifle!!!
If You had others but it was what was handy or similar, absolutely use it!
Are there better options and significant concerns/drawbacks? Sure. Although there are drawbacks and concerns in almost any weapon/caliber.
The muzzlebrake comment was actually good point, my 5.56 Bushmaster had the AK-74 muzzle brake on it. Goodness gracious great balls of fire! And loud! You might need more time than the bad guy to recover if you busted caps in the dark hallway etc. Just a thought , if someone is invading your home, muzzle brakes are not what you're thinking, certainly not just before your life is needing to be defended by busting caps with an AK-74 or anything else, imho. YMMV of course.