Can I enter a purchased game code on a separate Xbox One and still have it registered to my profile?

Xbox codes are tied to the account, not the xbox. If you are worried about it, just go to this link to redeem your codes - sign in, and redeem your code. Then you can download it to any xbox you are signed into.

Other accounts signed into the xbox marked as your 'home' console can then use the game your purchased/redeemed without you signed in and other consoles can only play that game while you are signed in.