I wonder if I have a google adsense account with one of my websites, is it possible to add the codes to a website that has been previously banned?
"is it possible to add the codes to a website that has been previously banned?" I think that is not a good idea. If the site was banned, then I guess your account can be banned too if you put ads on that site. If you purchased a domain that was banned, then you can correct the problem (if it still exist) for which the domain was banned, and then contact adsense support.
Generally speaking it's not possible. However someone posted here a nice tip on how to run AdSense on banned domain a few days ago.Basically the suggestion was to change the WHOIS info and contant the AdSense Support Team, explaining that you just bought that domain. While I didn't test it personally, it might actually works. Good luck!