I am new to Dungeons and Dragons and was wondering if only certain races or classes are allowed to have certain companions. Looking through some options, I rather enjoyed the idea of having a pixie companion as a human fighter, but wasn't sure if it was allowed.
Your options sorted by how much DM approval they need, sorted from least to most:
Rules As Written: Warlock
RAW, the only way for you to get yourself a pixie companion is to be a level 3 warlock and select Pact of the Chain specialization. (Technically it's a sprite and not a pixie but I assume "flying tiny fairy" is what you're looking for). So you could multiclass into warlock. You'd pick up some useful spells (Hex in particular) and your sprite would be more effective than a normal familiar, but it's not an optimal choice and you wouldn't get your pixie for 3 more levels.
Refluff Familiar: Eldritch Knight or a Feat
With the level 1 spell Find Familiar, you can get yourself a fey animal as a familiar. A sprite, like the other alternative familiars, has features beyond a normal familiar and is not in your list of options for the Find Familiar spell.
However, flying is an option (a hawk or owl), so fairy without extra features wouldn't be unbalancing. If you talk to your DM, they might be willing you to refluff (meaning change the description of a spell, ability, class, etc. without actually changing the mechanics.) your familiar into a tiny winged person instead of an animal.
In which case, getting the Find Familiar spell is much easier. At level 3, you can choose to become and Eldritch Knight, gaining 3 level 1 wizard spells, one of which could be Find Familiar.
If you'd rather not be an Eldritch Knight or you don't want to wait until level 3, you could use your variant Human feat to pick up Magic Initiate. It gives you two cantrips and one level 1 spell. So for the cost of a feat, you've got a familiar from the beginning and you're still free to pick whatever fighter specialization you want.
Background: Noble: Knight
I think most DMs would be willing to let you refluff your familiar as long as you aren't expecting any extra mechanical benefits. But what if your DM is feeling generous?
The noble background has a variant (Knight) that allows you to have three retainers. They are explicitly commoners who will only perform mundane tasks and not participate in combat at all. But it doesn't specify their race. A generous DM might rule that one could be a pixie.
Finally, you could find an NPC pixie. All previous points have focused on mechanical character features. They assume that you're trying to have a companion under your direct control. But Navi wasn't a class feature. She was a quest feature.
If you can convince a pixie that your quest is worthy, that you're just so awesome to hang around with, or that you will reward them, they might follow you around. This could happen in game, or you could discuss it with your DM as part of character creation. Work together to come up with a backstory that explains why a fairy wants to follow you around.
Just be prepared for it not to necessarily be an entirely beneficial situation. Maybe the pixie isn't actually following you out of benevolence, maybe you wrecked their grove and won't leave you alone until you make amends. Maybe they'd be lacking in social graces or will give away your position. Or maybe they'd be really annoying.
There is no class ability or feat in the official published D&D 5th edition rules that grants a single-class fighter a familiar or animal companion, much less a magical creature such as a Pixie. However, there also isn't any similar ability granting them the ability to have a pet dog, a romantic interest, or parents.
The simplest method for a DM to incorporate a pixie companion to a single-class fighter is to treat the Pixie as a Non-Player Character, possibly affected by the loyalty system described in the DM's guide, and definitely awarded a full share of XP for any combat encounter they participate in.
While it would not be difficult to write up a feat or martial archtype that grants a single-class fighter some magical companion, it should probably be more complicated than just using one feat to have a Pixie under the player's control. Although a pixie is only 1/4 CR, it has a selection of spell-like abilities that can be game-breaking at low levels.
The easiest way to give some actual game-rule credence to a human fighter's pixie companion might be for the human fighter to take the eldritch knight archtype at 3rd level, and interpret the various abilities as the pixie's magic rather than that of the fighter themselves. Abilities that don't quite match up could be adjusted at your DM's discretion, for which there are also guidelines in the DM's guide.