yes, as the code is calculated with the IMEI ("serial number") of your phone. and because the IMEI is unique for every phone the unlock code will still work... ;)
got an unlock code for my D750i and it worked allthough i flashed the phone to a W800i before i entered it :D