Absolute photometry of supernova remnants and emission nebulae in the Galaxy and the Magellanic Clouds