There are different levels of "counterfeit".
There's the clearly labeled and advertised GD32F103 style clone which is pin-compatible, supports higher clock speeds than the original STM32F103, but takes much longer to power on and has different analog characteristics, maybe some worse; not a problem.
There's the potential case where somebody sells you a GD32 telling you it's an STM32, either with the proper markings, with the markings sanded off, or with actually fake markings. This still might cause no problems, or might result in a problem that takes you a long time to track down. (Maybe you're unknowingly relying on, say, the hypothetical lower power consumption of a clone, so when you fab a
batch with real STM32s, the product's battery life goes to shit.) You can detect this in firmware and may be able to come up with workarounds. Or, if your vendor is FTDI, they may sneak malware into their Microsoft Windows driver and brick your products months or years after you've sold them. They've done it twice.
There's the case where the clone is designed to act as much like the original as possible, so maybe you can't detect the substitution in firmware and can't work around whatever problems the counterfeit is causing.
Then there's the case where you ordered 10,000 STM32s in a QFN-32 and got 10,000 QFN-32s that say "STM32" on them but are actually PICs with a totally different pinout, or SRAM, or something else. These will not probably still work.