The short answer is everything on the entire system — woods, electronics, and hardware — has some effect on a guitar or bass’s tone. When you fret a note, that fret takes over from the nut as the “anchor” for the note, so it’s definitely involved in transmitting vibrational energy. The width, height, and material (nickel-silver or stainless steel, typically) will have some effect on that vibrational energy — how much effect is a matter of some debate.
But while players can argue about the sound of various fretwire, the effect that frets have is far more about feel and durability than it is about tone. New, freshly dressed, and worn frets each affect the feel and the ability of a guitar or bass to intonate, and that will in turn affect the tone. And how you feel playing a certain width and height of fret definitely will affect how you play, and your playing will affect the tone. But the metal composition of the fret itself, while arguably it will have an effect, compared to the other components of the system, won’t be as large. With frets, in our opinion, feel and intonation are paramount, tone is secondary.