They aren't illegal. They just sit in the background and change a part of the game that is sitting in memory. (for example: God mode, infinite ammo, etc...). They are mostly for single player as far as I know.
http://en.wikipedia.org/wiki/Trainer_%28games%29
I have this exact same problem. 9800pro AIW. Only occurs on LC and DOD:S. Nothing in my system is overclocked and temperatures are fine (according to Motherboard Monitor).
I have 2Mbit DSL. Internet speed isn't really that big of a deal. I know people who play on 56k and they are fine outside of big cities. Ram is a huge factor in this game. Friend of mine has 1.5 gigs of ram and he doesn't lag nearly as much as I do.
Your computer will lag extremely badly in crowded areas. Specially Ironforge and Orgrimmar (Main alliance and horde cities). I have a 2.53GHz P4, 9800 pro, 512 MB of ram and I have to wait for a few minutes before I can move everytime I go into the org auction house or hearth there.