The link between software and hardware is difficult for some of us to understand; here’s everything you need to know about both to understand the answer to this question.
First of all, keep in mind that hardware comprises all of the physical, electrical components of your computer. That means circuits, transistors, diodes, disk drives, whatever; all of that is hardware.
Software, on the other hand, is simply the programs that direct the hardware. It takes software for your computer to know how to read the fact that you typed a particular keyboard on your computer and understand that when you closed that circuit, you meant for a particular letter to show up on screen in a particular place.
So can a program, which is basically just a particular ordering of 0s and 1s, actually cause your computer to undergo physical harm? Yes, and let’s examine how:
First of all, when you’re running programs, the program can determine what kind of load becomes placed on the CPU (central processing unit). If the load is substantial in comparison to the load that the CPU is meant to process, the core temperature of the computer could rise. This happens because the CPU is attempting to fire off more circuits at once than the machine is really meant to do; computers are only outfitted with so much coolant and therefore can only take so much electrical activity among its semiconductive electronic components (every time electricity is pushed through a semiconductive electric component, the component will resist the electricity’s current to some extent, meaning some of its electrical energy will be converted to heat. That will then cause too much electrical flow to generate too much heat).
Programs can control which electrical pathways are used in the microprocessor, so they can have instructions that cause the microprocessor to overwork. Some power viruses have actually been written with this intention in mind; some hackers just enjoy messing with people’s stuff and causing them some expensive misfortunes.
Other viruses have been written to mess up hardware: there are some clever programs that instruct a computer to constantly read-write files, which wears out the drive much faster than it would wear if it were utilized under normal circumstances. Hard disk drives meant to last years can be worn out within a weak this way.
If firmware is written so that BIOS settings can be modified, viruses can be written that increase the voltage to dangerously high limits, potentially damaging the RAM (random-access memory), CPU, north/southbridges, etc. Overclocking the PCIe bus could also damage some of those components.
If the PCIe/AGP bus is overclocked or the voltage is raised too high, you could definitely burn it or at least overvolt it until it degrades. That’s another way a virus could program your computer in such a way that its physical properties are damaged.