Localization of phonons and photons in random metasurfaces