There is no single "unlock everything" switch in Marvel Ultimate Alliance, but there are a few reliable routes to a full roster.
Most heroes and villains join your team as you push through the campaign. Progressing the plot, clearing the main missions, and completing side objectives will hand you the majority of the cast without any extra effort.
Some characters are tied to specific challenges, collectibles, or bonus scenarios rather than the main story, so it pays to explore each hub area thoroughly instead of rushing to the next objective.
On several platforms the game also accepts unlock codes entered through the appropriate menu or a third-party cheat device. These codes are widely documented in game guides, and they are the fastest way to fill out your roster if you would rather skip the grind.
One word of warning: codes and cheat devices tend to be platform-specific, so a code that works on one version may do nothing on another.