Your concerns are valid.
It depends on what sort of company. Ordinarily, the assets of a dissolved company will devolve to the owners. So, if we are talking about a sole proprietorship, then the person who owned it likely succeeded to the assets.
Sometimes, though, the domain name remains in the hands of some IT guy, contractor, former employee, whatever, who didn't really have formal authority to take over the domain name, but nobody noticed or cared. Sometimes, it is left in the hands of someone who did ask, "Hey, can I have the domain name" and received consent to do so.
And, yes, sometimes people do come out of the woodwork long after the fact to wonder where the domain name went.
On the other hand, one question that's never been answered to my satisfaction is this:
SomeCorp Inc. was the registrant of Somecorp.tld, with an expiration date of June 2015.
SomeCorp Inc. went belly-up and was dissolved in February 2015.
Ann Employee had the domain name in her GoDaddy account at the time. When the corporation was dissolved, nobody thought about or cared about the domain name.
In June 2015, Ann Employee renews the domain name, and has been renewing it ever since.
One question you might ask is - At the time of dissolution what, exactly, were SomeCorp's rights in the domain name?
One answer would be that SomeCorp was the proud owner of a domain name that had an expiration date of June 2015. Absent renewal of the domain name by SomeCorp in 2015, they no longer owned the domain name.
The problem with that answer is that you can argue that SomeCorp's rights in the domain name only lasted until June 2015. But, it's unclear how that makes the domain name "belong" to Ann Employee.
I recently dealt with a situation very much like this. A client was looking to broker a domain name which would be a really nice short dictionary word domain. The domain name had been registered a long time ago as part of a project that a large company had undertaken under a contract with a government. The project, and the contract, eventually ended, and the domain name ended up in the hands of "some guy" who had worked on the project. He said the company had informally said he could have the name when the project wound up.
One problem with a name like that, particularly if you are ultimately interested in selling it to a corporate buyer is that the next buyer may want some kind of warranty of title. The broker found a potential buyer who wanted, as a condition of purchase, some kind of documentation of how "some guy" was authorized to take over the domain name, and the situation ended up being a stalemate since they registrant couldn't provide evidence of his authorization and, years later, couldn't get anyone who was formerly with the company to sign off on anything to that effect.
So, whatever might be your comfort level with this pretty common murky scenario, you also have to consider whether a future buyer's comfort level is going to match up with yours.