This gets quite complicated.
If you, as director, allowed the company to be dissolved incorrectly, you can be prosecuted because you didn't fulfil your legal responsibilities.
If the company was dissolved with assets (money or physical assets), which seems quite likely if you were paid legal dividends, what happened to those assets? If you have acquired them, you have misappropriated assets which don't belong to you personally.
Should HMRC or Companies House decide to go down this route, you can be charged with some serious offences. In effect, you appear to have stolen assets.
I'm not saying you have done this deliberately and a great deal is going to depend on the amounts involved. If you had £40,000 in legal dividends that implies a profit in excess of £50,000 and tax of around £10,000.
HMRC have the right to reinstate the company (and charge you around £2,000 for the privilege) then demand the tax from the company. This is unusual but not unknown.
If you want to be absolutely clear you could probably write to HMRC giving them a final CT600 for the company and offering to pay them yourself. If they decline on the grounds that the company has ceased, you are in the clear. We had a similar situation a few years ago and received a nice letter from HMRC saying that, in view of the low amount (around £800) they would write it off and not pursue it further,
I suggest you get an accountant to prepare final accounts and CT600 then write to HMRC.
Or you could just do nothing and HMRC might not ever bother - very likely.