Been looking a lot into this recently since a friend and I were thinking of holding up a stall for fanarch and fanmerch (mostly helping her with anime fanmerch) at our local con either next year or the year after.
What are you looking to make? T-shirts or something small as stickers and badges? Also where do you plan to sell them? Online or at a convention of some sort? Of course if you just want some fanmerch for youself it shouldn't really be that much of a problem.
Technically it isn't legal: " You cannot use copyrighted characters to produce your own fan-made items and sell them for profit unless you pay to license the character(s)" but people will still do it. I'm not 100% sure how exactly sure how strict exactly Nintendo is, but I know
they have banned a pretty awesome project. I have heard companies like Disney and Marvel (I think?) are way stricter on the sort of thing. Obviously there is so many people making fanmerch it's not easy for a company to stop everyone of them all. "People tend to get away with it because selling fanart based on Pokemon helps generate more interest in the original franchise, sort of like 'free' advertising" it has been said many times.
When a company does sue, it'll be because the seller usually has a significant amount of the number of sales. Maybe you made a pokemon t-shirt for $20 or $30 and you sold 5000 of them or something. The company would more likely come at you than if you've only sold around 200.
I have heard other things like no mentioning it's Pokemon or that the pokemon in the merch is Pikachu can help as well as making your work look way far from the original to make them more "fanarty" will make it easier to get away with it, but I have no clue how that works for some people.
Legal: No.
Likely to get sued: Probably not any time soon.