that would probably work, but the question is how efficient would it be?
space and earth are about 60 miles apart vertically and a rod of a certain width can only conduct a certain amount of heat.
It would take either some very large rods or many masses of them.
I think we have many places on earth where we can find temperature differentials that are closer together
A lot of people heat their homes with heat pumps that work on a similar principle but by putting pipes into the earth or a body of water where it is warmer.
Thermoelectric generators that generate energy when exposed to different temperatures have been around for a long time, that's a real technology that you can experiment with at home. the problem is they are not that efficient. They are used in cheap 12v electric coolers.
https://www.amazon.com/Thermoelectric-Generator-Peltier-Cooler-Demo/dp/B003FJ6I0Y
none of these things are free energy though, Tesla would be exploiting the energy in the heat of the earth like geothermal plants do now.