Yes, Teensy 4.0 has tone().
Output mode is similar, so you should see (hear) similar results.
Many of those piezo transducers can output a large positive or negative spike voltage if it is struck by a hard object. Whether yours does this, I can't know. But if it can, both Teensy 3.2 and Teensy 4.0 could potentially be damaged, especially if the pin is configure for input mode or hasn't been configured at all.