Ballmer may not be the best visionary, product person, or have a good nose for the market.
But I really don't think MS could do anything to compete with the Internet era, and its results would likely be extremely similar with Gates in charge.
Also... let's not be revisionist. Gates was there long enough into the Internet era for us to know what he thought/how he responded. His attitude and approach was quite similar, and in some ways worse.
He was much less complicit to web standards on both the client and server sides.
These days, MS's intranet products retain this approach (Sharepoint), but its Internet ones are really good citizens and saying all the right things (Azure, PHP friendliness. Silverlight is old-school, but still less borg-y than stuff released in Gates-era). It's only that we have absolutely no reason to use the MS web-stack, and (rightfully)have trust issues that explains their lack of popularity.
So yeah... Ballmer is a dork. But MS's gradual demise is a natural effect of the Innovator's Dilemma and the Internet.