Nightwing is unlocked in LEGO Batman 2: DC Super Heroes by completing the story rather than by entering a password. Once unlocked, he can be purchased for studs and used in Free Play.
If you were after a specific code, note that the game uses character unlocks and cheat codes entered from the pause menu, not passwords — and any code circulating without a source is usually wrong.