is it legal to cut of factory stab in plugs and replace with wire nuts
Yes... Maybe... Technically, probably not.  

But let's talk first about why you want to cut off the quick connect fitting.  If you want to remove the factory installed connector, because you've read all over the internet about how bad "backstab" terminals are. I understand your concern, but you're probably overreacting.  The "backstab" terminals the internet rants about, were poorly designed terminals that were built into devices (receptacles, switches, etc.). Modern "push-fit" connectors are a bit different, and are designed with past failures in mind.  

It's very common for newer light fixtures; especially recessed fixtures, to include "push-fit" connectors. These connectors make wiring the fixture easier, and are used by most installers. These new connectors seem to be reliable, and don't appear to suffer the same failures as the old "backstab" terminals. However, loads of folks still have a bias against these connectors, because of the poorly designed "backstabs" that proceeded them.

&lt;/rant&gt;



As for removing the factory installed connectors. Technically, removing them is modifying a factory assembly. Which technically probably voids the UL listing. And is technically against National Electrical Code, since you're not installing the fixture according to the manufacturer's installation instructions.

However, I'm sure loads of people do it, and it's doubtful that an inspector would ever fail an inspection because of it. As long as you use the proper sized twist-on wire connector, and make a solid connection. There should be no problem removing the connector, and using twist-on wire connectors instead.



NOTES:  


I don't have any statistical data on push-fit connector failures, so have no way to prove if they're better or worse than backstab terminals. At the end of the day, it's about your peace of mind. If you're not comfortable with push-fit connectors, then don't use them.