Nah, most affiliate networks aren’t shady or illegal. The big names like Amazon, CJ, ShareASale, and Impact are totally legit, they’ve been around for years, pay properly, and have proper tracking.
That said, some smaller or dodgy ones can be a bit sketchy, usually the ones that promise crazy...