Perhaps splitting hairs, but there's nothing illegal about using wire nuts. There's no law prohibiting their use, there's no entity with enforcement powers. They *are* specifically prohibited in ABYC standards, but that's a standard or recommendation, not law. Lots of folks refer to ABYC compliance in relation to legality, it's a voluntary standard, not to be confused with building/electrical/plumbing *code* which is codified by law, and has entities with enforcement powers e.g. your local building code enforcement official. Officer of the court. No parallel agency exists in the boating world, other than USCG, but that's a different can of worms.
Not so in Canada. Excerpt from Transport Canada Construction Standards shown below.
Transport Canada and USCG are currently negotiating harmonization of their legal requirements and using ABYC in their entirety. Transport Canada already includes a number of the ABYC Standards in their construction Standards.
This was supposed to occur last July but we have a problem with Quebec and translations.