So in essence, the only difference is the software, but the hardware is basically the same.
It depends on what exactly you call "software" and what "hardware".
So given, for example, an Ethernet switch, can we reprogram it to act like a telephone switch, and vice versa?
Depending on how the switch is built, it might be possible to reprogram an FPGA-based Ethernet switch in a way that it connects two Ethernet ports permanently until a certain bit pattern is detected.
However, I doubt that there are many Ethernet switches using FPGAs.
You might argue that the wiring of a gate array is some kind of "software" and not "hardware" (*). However, this kind of software is etched into a microchip during the production and cannot be changed later on. So it would not be possible to reprogram a switch using such a type of microchip.
If the switch uses a full-custom ASIC, the functionality (packet switching) is definitely done purely in hardware and there is nothing involved that you could call "software". You cannot reprogram such a chip either.
(*) Until the mid-1990s, firmware (like the PC BIOS) but also application programs were often stored this way in "mask ROM" microchips. So the fact that some algorithm is represented by an unchangeable wiring in a microchip does not imply that this wiring is "not software".