Aims. We present an analysis and comparison of the 30 μm dust features seen in the Spitzer Space Telescope spectra of 207 carbon-rich asymptotic giant branch (AGB) stars, post-AGB objects, and planetary nebulae (PNe) located in the Milky Way, the Magellanic Clouds (MCs), or the Sagittarius dwarf spheroidal galaxy (Sgr dSph), which are characterised by different average metallicities. We investigated whether the formation of the 30 μm feature carrier may be a function of the metallicity. Through this study we expect to better understand the late stages of stellar evolution of carbon-rich stars in these galaxies. Methods. Our analysis uses the “Manchester method” as a basis for estimating the temperature of dust for the carbon-rich AGB stars and the PNe in our sample. For post-AGB objects we changed the wavelength ranges used for temperature estimation, because of the presence of the 21 μm feature on the short wavelength edge of the 30 μm feature. We used a black-body function with a single temperature deduced from the Manchester method or its modification to approximate the continuum under the 30 μm feature. Results. We find that the strength of the 30 μm feature increases until dust temperature drops below 400 K. Below this temperature, the large loss of mass and probably the self-absorption effect reduces the strength of the feature. During the post-AGB phase, when the intense mass-loss has terminated, the optical depth of the circumstellar envelope is smaller, and the 30 μm feature becomes visible again, showing variety of values for post-AGB objects and PNe, and being comparable with the strengths of AGB stars. In addition, the AGB stars and post-AGB objects show similar values of central wavelengths – usually between 28.5 and 29.5 μm. However, in case of PNe the shift of the central wavelength towards longer wavelengths is visible. The normalised median profiles for AGB stars look uniformly for various ranges of dust temperature, and different galaxies. We analysed the profiles of post-AGB objects and PNe only within one dust temperature range (below 200 K), and they were also similar in different galaxies. In the spectra of 17 PNe and five post-AGB objects we found the broad 16–24 μm feature. Two objects among the PNe group are the new detections: SMP LMC 51, and SMP LMC 79, whereas in the case of post-AGBs the new detections are: IRAS 05370-7019, IRAS 05537-7015, and IRAS 21546+4721. In addition, in the spectra of nine PNe we found the new detections of 16–18 μm feature. We also find that the Galactic post-AGB object IRAS 11339-6004 has a 21 μm emission. Finally, we have produced online catalogues of photometric data and Spitzer IRS spectra for all objects that show the 30 μm feature. These resources are available online for use by the community. Conclusions. The most important conclusion of our work is the fact that the formation of the 30 μm feature is affected by metallicity. Specifically that, as opposed to more metal-poor samples of AGB stars in the MCs, the feature is seen at lower mass-loss rates, higher temperatures, and has seen to be more prominent in Galactic carbon stars. The averaged feature (profile) in the AGB, post-AGB objects, and PNe seems unaffected by metallicity at least between a fifth and solar metallicity, but in the case of PNe it is shifted to significantly longer wavelengths.