Is “The door creaked.” an example of an onomatopoeia?

No.

Onomatopoeia is a word that imitates a noise. To go along with the example, using onomatopoeia with that particular sentence would be more like, “The door went ‘creaaaaak’.” because the word indicates the noise, etc.