Selling/transferring/trading/giving accounts is against the EULA, yes.
Dunno how illegal-illegal selling the CD-key itself is. It's bit like selling an used game, tho there is no guarantees that the CD-key isn't used already. Scammers ahoy.
Never-ever-ever buy an account from someone else. Besides being a EULA violation, Raiin Maker is dead on. 99.999% of the time, it's a scam. Say someone sells you their account and you can even log on to it, they can always go back to Anet support and reclaim it and there's nothing you can do about it.