What if Oracle hadn't bought Sun ?
Then Sun would have died by itself. The corporate culture was broken, the decision making (what to invest it, what to build, what to try selling) was disfunctional. The CEO was an complete nut case (sort of the prototype of what Elon Musk became later), the senior technical decision makers (in particular Bechtolsheim) had RDFs (reality distortion fields) appropriate in size for Steve Jobs, but unlike Jobs, they didn't have the genius to make their distortions into products. The relatively small dot com bubble took that leaking ship and made it capsize. When a lot of senior architects and employees with 2-digit employee serial numbers started quitting in the early 2000s, I knew it was over.
What would happen if IBM bought Sun ?
First, as Cracauer already said, they wouldn't have, nor couldn't have. Second, IBM is very good at ruining companies it buys. Or morphing them into something completely different. RedHat is probably the first major IBM acquisition that hasn't completely failed.
And imagine what the world could be with Sun Microsystems nowadays.
Today, everyone in the open source world loves to hate Sun, for being closed source, licenses, and patenting. But we also have to remember how much they contributed to open source. For example NFS.
What if Compaq didn't bought DEC?
Digital was dying even worse than Sun was. Again, corporate culture, broken CEO, lack of technical direction. Remember, having technically good products isn't all that's required for being a good technical product company. Matter-of-fact, some of the best high-tech companies (those that have lived for a long time, made a lot of money, and served their customers well) usually had mediocre products. Sure, things like the PDP11, VMS or Alpha were genius. But customers don't need genius; they need affordable and productive systems, with great support, which are designed to fit the needs of the customers. And the need of the customer is not "a super fast CPU" or "an OS with the greatest command line parser", but something that makes the customer's business work well.
And that is why IBM is still there. It is still very large (second only to the FAANGs in the number of engineers doing computers), has been there for 125 years, its stock doubled in the last 5 years, and the few of my old colleagues who haven't retired yet are quite happy there and enjoying their jobs. Very few have been laid off.