You have several problems here, let's assume the logistical ones are all solved (as they already are for long distance tunnels) and just focus on the engineering ones.
You have six problems with a tunnel through the magma:
- Making the hole
- Temperature
- Pressure
- Leaks
- Seismic activity
- Currents
Making the hole
Actually making the hole is easier in the liquid area, assuming you can exert sufficient force you can just push the liquid mantle out of the way and it will flow. The problem is stopping it from filling back in again.
Temperature
The mantle has a temperature ranging from 500°C to 4000°C. (Some research suggests the core may even reach 6000°C). Even Tungsten melts at those temperatures. Diamond will melt at around 4000°C so might survive if you made the tunnel out of pure Diamond, but that's at atmospheric pressure. Increase the pressure and even Diamond melts before you reach the core, bringing us on to our next problem.
Pressure
You are talking 140GPa (Gigapascals) of pressure. That's 10,000,000 times atmospheric pressure. The walls of the tunnel would need to be incredibly strong to withstand the pressure, or the interior of the tunnel would need to be pressurized to the same level which would make travel through the tunnel problematic to say the least.
Leaks
At those temperatures and pressures even a tiny leak would quickly become catastrophic and you could well lose the entire tunnel.
Seismic activity
The tunnel would be vulnerable to shocks and quakes in the upper areas before it reaches the mantle itself. These forces would act to deform, twist, or even sheer straight through the tunnel.
Currents
The mantle is flowing, the lava is moving. This movement would try to carry your tunnel along with it. That would provide a lot of stress into the already stressed material and again would cause the tunnel to flex and move as the mantle flowed around it.
Conclusion
It's not possible with any current scientific ability to dig a tunnel through an earth-like planet. A smaller planet with a cooler core would be a different matter.
The materials science needed is incredible, and most likely physically impossible. The development of force fields and other non-material reinforcement might make it possible in the far future but such concepts are speculative at best.