There are couple of social-engineering, fake version of ledger live and manipulative type malware and viruses out there that can make you sign a fraudulent transaction (not without your consent) though.
This can't be stressed enough.
The whole point of a hardware wallet is to protect you from viruses and malware on your computer which would otherwise be able to steal your coins if you were storing them on a simple software wallet. Any transaction you make (with any wallet) requires the transaction to be signed with your private key before it can be broadcast. With a hardware wallet like Ledger, the private keys are stored on a secure element and never leave the device. Therefore, to sign a transaction, the transaction has to be sent to the device, signed inside the secure element, and then sent back to your computer. In this process of signing the transaction on the device, the device displays the receiving address and amount of bitcoin to send, and you have to manually check and confirm this is correct.
There exists malware which can take over the software on your computer and generate malicious transactions (such as trying to send all your bitcoin to an attacker's address). With a hardware wallet, as explained above, before this transaction could be made, it has to pass through your hardware wallet, meaning it has to be displayed on the screen and you have to manually confirm it before it can be broadcast. Therefore, although using your hardware wallet with a "hacked PC" as you put means you are still vulnerable, your coins can never be stolen provided you double check all addresses and amounts on your Ledger device's screen prior to confirming.