Yes, a virus can damage hardware components such as the hard drive or motherboard. Malicious code can cause physical damage by overwriting data or corrupting system files, leading to permanent and irreversible harm to the affected hardware.