Using existing widget code! [closed]

It depends entirely on the license of theme you’re intending to make a derivative work of.

You’ll find a related debate on wordpress.org here: http://wordpress.org/support/topic/theme-licensing

…and another individuals cumulative research on the matter here: http://bloggingexperiment.com/is-blogging-experiment-breaking-the-law

Additionally, here’s an example of the a web designer legitimately modifying a premium theme on Theme Forest and reselling it as his own (Stack Overflow): https://stackoverflow.com/questions/17024882/can-i-edit-a-wordpress-theme-gpl-licensed-and-then-sell-it