It's not legal but it goes mostly unpunished or at the very least when things are taken down they are quickly replaced. There are multiple reasons for this, especially in fandoms where the bootleg merch actually meets a demand that original merch doesn't meet.
I will admit right now that I have a bootleg Ten Count phone case. Why? Because the official ones were boring as fuck and the model they came in just wasn't what I was looking for, because I know damn well with phone wallet cases that I am 100 times more likely to end up crushing my screen. This completely defeats the purpose of having a phone case.
I wanted to buy an official one to support the original creators SO BAD. But at the end of the day, in my case, they just didn't meet customer demand. So I found one I liked on redbubble and bought that, cursing under my breath about those few dollars of revenue going to some thieving douchebag instead of the artist I wanted to support. It's not even fanart, it's a stolen illustration!
It's a simple phone case. It is a combo of the two first covers of the series. The original publishers could have very easily met this demand themselves.
The official phone case on the other hand barely even looks like it's merch at all to my memory.
This isn't a new thing. Bootleg band merch for example has existed since before the internet went big and they filled the exact same purpose. Some bands just have really shitty merch. Or little to none at all.
Most people aren't stupid. A small few will buy the bootleg crap because it's cheaper, but most fans want genuine merch because genuine merch has higher value both from a fans standpoint, collectors standpoint and in supporting the content in question.
The best thing you can do (and what I try to do) to battle bootleg fan merch is to fill the demand yourself. If you do, the amount of bootleg merch being published will lessen and fans are less likely to buy it.