Yes, you'll be fine! A traded Pokemon will not affect the validity of the serial code you enter. As long as it is the first time you have used the serial code for that cartridge, you should be able to get the Pokemon.
Hope I helped. :)