What does the 1M resistor do in this circuit? (knock sensor)

Would not damage the arduino, but might load down the piezo too much and thus you would not see a measurable voltage.

The piezo puts out some current - that current needs to go somewhere. The 1M gives it a place to go besides into the arduino.
You still need some to go into the arduino for the ADC's sample & hold to charge up - 10K might drain too much away and not leave enough to allow the sample & hold to charge up.