Primordial gravitational waves from black hole evaporation in standard and nonstandard cosmologies