Pianos can't be tuned perfectly using harmonic tuning, because they have a string for every note. See this MinutePhysics video for a good explanation of why.
But with current technology, we could theoretically create an instrument that tuned every note harmonically according to the previous note. For example, if one played A440 and then D5, D5 would sound at 440 * 4/3 = 586.333... Hz. But playing A440, then E5, and then D5 would cause the D to sound at 440 * 3/2 * 8/9 = 586.666... Hz.
How would this instrument sound, and would it sound in tune playing an equal-tempered piece?