It is probably hard to say, from the outside they often look legit. I have seen one once, but it became more apparent when we compared it to a genuine charger (usually the print is off in some way). Since counterfeit chargers typically have fewer components, apparently weighting the charger can also help finding counterfeits:
In my limited experience, counterfeit iPhone chargers do not have a serial number printed inside the USB connector. Real ones do have it. I've found this picture that shows they've started printing a "serial number" on the fake ones too https://apple.stackexchange.com/questions/243541/how-to-diff...
https://www.electricalsafetyfirst.org.uk/blog/how-to-spot-a-...
Of course, it's probably not beyond them to add some weight to make you believe it is real.
I guess if you have the right tools, you could also measure output quality.