How can I access an old OneDrive folder in an old hard drive?

First, what do you mean by, "LaptopA broke?" What broke on the PC? If it was the HDD, then it might be possible to recover some data from it... or not.

Second, did you encrypt the OneDrive folder? If so, you'll need to unencrypt it.

Third, could you access other folders on the HDD? If not then it is likely the whole HDD is encrypted or damaged.

Fourth, if the issue is due to Windows preventing access, make a disk image, for example using Macrium Reflect Free or an alternative. Open the image file ("browse image") in the application, enabling access to restricted folders. Making a disk image is also useful, in case your attempts to access the removed HDD causes damage.,

Another way to access restricted folders is using another OS. For example, you can put Ubuntu on a USB flash drive and use it without needing to install Ubuntu, to copy the folder to the new PC drive.