Transient heat transfer in superfluid 4 He (He II) is a complex process that involves the interplay of the unique counterflow heattransfer mode, the emission of second-sound waves, and the creation of quantized vortices. Many past researches focused on homogeneous heat transfer of He II in a uniform channel driven by a planar heater. In this paper, we report our systematic study of He II transient heat transfer in nonhomogeneous geometries that are pertinent to emergent applications. By solving the He II two-fluid equation of motion coupled with the Vinen's equation for vortex-density evolution, we examine and compare the characteristics of transient heat transfer from planar, cylindrical, and spherical heaters in He II. Our results show that as the heater turns on, an outgoing second-sound pulse emerges, in which the vortex density grows rapidly. These vortices attenuate the second sound and result in a heated He II layer in front of the heater, i.e., the thermal layer. In the planar case where the vortices are created throughout the space, the second-sound pulse is continuously attenuated, leading to a strong thermal layer that diffusively spreads following the heat pulse. On the contrary, in the cylindrical and the spherical heater cases, vortices are created mainly in a thin thermal layer near the heater surface. As the heat pulse ends, a rarefaction tail develops following the second-sound pulse, in which the temperature drops. This rarefaction tail can promptly suppress the thermal layer and take away all the thermal energy deposited in it. The effects of the heater size, heat flux, pulse duration, and temperature on the thermal-layer dynamics are discussed. We also show how the peak heat flux for the onset of boiling in He II can be studied in our model.