If the mechanics of the game dictate, as they did in the 1st Edition PHB (prior to Unearthed Arcana) that only humans could be rangers, or paladins, or druids, then you cannot play Legolas or anything like him. Yes, you could play an elven fighter that was good with a bow, but if you wanted him to have sharp eyes, or sneaky skills like a ranger, then you're out of luck. Mechanics can and do effect characters, whether you like it or not. Dwarven paladin of Moradin? Tough luck. Elven druid? Oh well, better luck next time. Third Edition places certain constraints on this sort of flexibility, as well. The Grey Mouser would be very conceivable as a human, or an elf, or a halfling, but not a dwarf or half-orc because of racial class limitations.
Third Edition gives you more options out of the box with less divine intervention from the DM. It's not a perfect game, but it does that better than 1st Edition. A roleplaying game that forces me to be a pawn, or a rook, or a bishop because of "the party is the protagonist" is trying desperately to compensate for an evident weakness.
Mechanics do not equal roleplaying, but they are related. If they weren't, then we'd all be playing freeform roleplaying games.
Mechanics can improve roleplaying, or hurt it. 3rd Edition makes certain types of roleplaying more difficult to achieve. Low magic games are one of those, for example.