To determine whether two tubes are electrically compatible, you must check the operating parameters, the maximum conditions, and the heater requirements.
Heater requirements are just the voltage and current needed. Performance parameters for triodes are gain (mu), transconductance (gm) and plate resistance (rp, sometimes ri). Any two of these will determine the third.
Operating limitations are maximum plate voltage, maximum cathode current, and possibly other items which may be mentioned in the data sheet. Here you have some leeway; the replacement must tolerate the actual circuit but need not match the original's maximum conditions if they are higher than the circuit demands.
The 6H6P has an rp of 1.9k, less than a quarter of the 12AU7, so even though the mu at 20 is close enough the 12AU7's value (17) the tubes are not compatible.