Exists probability that you will got somewhere buzzer device with internal frequency generating circuit.
But most probably, you will got device, which just transforms electricity to sound waves.
For such devices, the most important features - are their resistance and loudness (when have comparable size/weight), and unfortunately, exists extreme difference of piezo vs electromagnetic speakers in these.
For resistance: most small electromagnetic speakers used in computers have resistance approximately 8 Ohm.
piezo buzzers are very differently, physically equivalents to serial connected capacitor and inductance, but for case of microcontroller (Arduino) could considered to equivalent of 100 Ohm resistor.
For loudness - electromagnetic speaker is magnitude loader than piezo.
Conclusion - in most cases, piezo could been directly connected to digital cmos outputs (for better safety, you could wire it with 150 Ohm current limiting resistor).
Electromagnetic speaker needs some source of high current, and sure, for higher quality sound this source should have linear characteristics, and most microcontrollers could not feed high current.
But in case of microcontroller, could been used some simple circuit, like transistor switch circuit (open collector transistor switch circuit).
And sure, in case of electromagnetic speaker, you should use some sort of DC current limiter, for example, attach capacitor between mc pin and transistor, or write program which will not feed speaker with constant current.
Update: for other interesting things, I remembered, that any transformer (or just any coil with ferromagnetic core), could output sound.
It's very common, when power transformers output high sound. For example most TV's output it. Usually this is not very loud, but in silent room could hear.
Also few times I have hear high sound from voltage stabilizer, when computer run some programs, because power supply of this computer does not have PFC :)
Few times I have hear ring of analog voltmeter, when used some high power device like welding machine.
Update: About coils with cores - remembered, noise is one of things, with which people making/using brushless electric motors struggle.
Because brushless motors are some combination of coils with cores, they output unwanted sounds. And in most cases, people used high frequency currents, so these motors output ultrasound, which people don't hear.
In some cases, controller electronics could not make control currents with high enough frequency, and could been hear sounds like squeaks or even screams.