My father was a medical doctor in the army. He rose to the rank of Colonel and they wanted him to become a general, but he didn't want to put in the number of years that would required to get his pension at the general level, so he declined. So... yes, you can become a general with zero combat experience.
For sake of analogy, I simplified. There are many pathways up the ranks, and the general of today may not ever engage in a theatre of war depending on country.
Experience however, does contribute to one's station -- whether basic training, joint exercises or in inopportune times, the battlefield.
And the famous early computer scientist Grace Hopper retired as a rear admiral in the US Navy despite not having combat experience either. But that's because she was career Navy, and basically the only way the military can give you a promotion is by increasing your rank.
That's kind of a loaded question from an ethical standpoint, because the obvious answer ("No") tends to justify getting into an unnecessary war every so often to keep your armed forces from getting too rusty. But it's an interesting one.
A better analogy would be a general who had never been a junior officer.
It's possible in theory. Someone with unique skills can be directly commissioned at the O-4, O-5, or even O-6 ranks without ever being a junior officer. After commissioning they can eventually be promoted to O-7 (brigadier general or equivalent) just like any other officer.
You might want to change that to "lead in a war?" There's a bunch of high level people at the Pentagon that are glorified procurement officers.
My university had a former chairman of the Joint Chiefs of Staff[1] as the president when the pandemic hit. IMO we were lucky to have him as president.