As ZMC888 advises beware cheap no name mufflers, especially no name mufflers from Ch!na.
However, lots of motorcycles the world over have, have fitted after market mufflers seemingly without negative consequences.
I've a Akrapovic on my Super Tenere (S10) 1200Z and it runs fine, passed safety inspections without issue and like many other S10's the fitting of a branded after-market muffler works wonders based on the posts on a number of ADV and S10 specific forums anecdotally suggest.
I've a IXIL hex shaped muffler on my 650TR and it runs fine, passed the local safety inspection late last year, including the exhaust outlet gas emission test analysis - which fell below the EU-III maximum levels.
A friend has a Yoshi muffler on his 2006 TMax scoot, and it has runs fine without issue, and the scoot has passed several safety inspections.
Buy a quality after market muffler, here are just a few brands:
Akrapovic
Two Brothers
IXIL
If after-market mufflers were an issue for emissions then the companies wouldn't be in business. Some manufacturers even offer after-market muffler brands as an upgrade option at point of sale through dealers e.g. Suzuki, BMW, Kawasaki
et al.
You could buy a Power Commander and visit a tuner with a dyno, but many motorcycle owners don't.
Do a search on you.tube, and you should be able to find a few 650NK videos showing muffler mods.