In English these names are used as a substitute for the average guy. Or as a specimen when filling out a passport form.
What names/expressions are used in Spanish for this purpose?
That's depends on the use and, as far as I know, there is no official denomination.
On graves: Desconocido/a + number or Indocumentado/a + number
Official forms/documents: They usually use a common name + common surnames something like María García García or José Pérez García or even Nombre: Nombre Apellidos: Apellido Apellido
Surnames for un-recognized children (in Spain and out of use): Expósito
While talking (informal): Fulano, Zutano, tío, as in El fulano/tío ese de ahí, El otro día Fulano y Zutano... (used if you want to talk about the events without saying who did or said what).
And, as said in comments, Mengano and the diminutive forms fulanito, menganito, zutanito.
A formal equivalent of John Doe (e.g. legal matters) in Spanish is N.N., derived from the Latin nomen nescio. Fulano, Perano, Zutano, Mengano, etc are used informally.