If you have a valid Windows 7 Home Premium or Professional key, you cannot directly upgrade to Ultimate using a different key. You would need to perform a clean install of Ultimate using an upgrade key—but this is rarely practical.
Using a from a reseller or old sticker is legal if the license is genuine. However: product key windows 7 ultimate 64 bit build 7600 install