other answers are good, heres another angle. its worth pointing out that many elite corporations have very good, even world class R&D departments that have research quality on the level of, or exceed, top universities. in some cases it can be very theoretical but in other ways its a much more applied research related to building products, creating new applications, enhancing existing products, etcetera, ie a different applied/commercial/profitability focus vs university research. but notice also its usually only the much larger corporations that can afford it.
its possible to get internships or jobs in these areas & it can be a nice hybrid area of the [at times abstruse/esoteric] theory of academia vs the [admittedly more narrow] applied focus of corporations in general.
here are several companies renowned for world class CS research departments or at least some CS-focused R&D activity:
another alternative (as mentioned in comments) are tech startups which sometimes need specialized experience in advanced/theoretical CS technology. there are many examples of this but a few come to mind: