Your Marinara Needs Onions or Garlic, but Not Both
A few years ago, I read somewhere that Italians never use onions and garlic in their marinara; it's always one or the other. Like so many black-and-white cooking "rules" you come across online, this one didn't stand up to cursory Googling--it might be true in some regions of Italy, but it's more of an old-school superstition than an inviolable law of Italian cuisine. Sometimes, though, you have to hand it to old-school superstition: When I started using only garlic in my red sauce, I genuinely felt like I'd unlocked a central secret of the universe.
Superstition or not, choosing between the two alliums makes a lot of sense. Onions and garlic complement each other for sure, but when they're combined, they almost cancel each other out. Rather than the distinct flavor of onion and garlic, often you what you taste is simply "something good." If you stick to one, its flavor becomes a feature of the dish rather than a supporting role. In a dish as simple as marinara, this choice ends up making a huge difference in the flavor profile of the finished sauce; you can really taste every ingredient, especially your allium of choice.
For me, that allium is garlic every time. With the very notable exception of Marcella Hazan's tomato-butter sauce, I've always been lukewarm at best about onions in my red sauce. It's mostly a texture thing: Minced onions melted into olive oil or butter is one thing, but a medium-to-large dice in an otherwise silky sauce just upsets me. Meanwhile, even roughly chopped garlic ends up pleasantly soft when simmered for a long time. I also just prefer the stronger flavor that garlic brings to the table, particularly when it's combined with cooked tomatoes and olive oil.
My red sauce recipe is barely even a recipe at this point, but to give you an idea, here's how I make it. I cook 10-12 cloves of chopped garlic, a teaspoon of crushed red pepper, and half a cup of olive oil in a very big pot for 5 minutes over medium-low heat. While that's happening, I use my stick blender to puree a #10 can of whole tomatoes (which is about 4 28-ounce cans), then add that to the pot. I bring the whole thing to a hard boil and keep it there for maybe 5 minutes, then reduce the heat and simmer until it's reduced by almost half and the oil has started to separate. This usually takes about 4 hours. I finish it off with salt, sugar--I buy cheap, acidic restaurant supply store canned tomatoes; sugar is an absolute necessity--and extra red pepper to taste.
To me, my red sauce is perfect: Super-garlicky, slightly spicy, and with loads of rich, balanced tomato flavor. (All that olive oil almost confits the tomatoes as they cook down; bellissimo, as they say.) But I think it would be just as good with onions instead of garlic, particularly if you prefer a milder, sweeter sauce. You could even swap the olive oil for butter, and maybe brown it first--I'm sure Marcella would approve.