No, LEGO Harry Potter games do not use traditional "character codes" (alphanumeric cheat sequences). Instead, all content is unlocked through gameplay:
Progression is designed around exploration and achievement, not cheat codes. For specific unlock guides, consult online walkthroughs or the game manual.