IIRC there's a news that lead you a problem when you bought a coins from criminal, but I didn't remember where's the sources. I guess it depends how much you bought, let's say you bought from a hacker that stole 2 BTC and you bought 1 BTC from him, the another 1 BTC he send to other wallet. If chainalysis can track the source and linked with your identity, then it's possible you will have a trouble since they suspect you're the criminal.
To avoid it depends on how good you hide your trace and your privacy concern, of course Bitcoin mixers will help in this case.