Yes, the original Lego Star Wars includes a lightsaber duel mode, and it is unlocked rather than available from the start.
You gain access by completing a specific mission in the campaign. Once that requirement is met, the duel becomes selectable, and it is worth doing because the combat in it is deliberately over the top compared with the main levels.
If it is not showing in your menu, work through the story missions you have not yet finished rather than searching for a code, since progression is the only trigger.