The energy transformations are similar because they result into radiant energy.
As for the lamp, Electrical energy is transformed into light when the filament
or mercury vapor glows on passage of current.
The fire- chemical energy is turned to light energy during the combustion of carbon. Both products comprise of ultraviolet radiation which is a form of radiant energy.