This is true, to first order, for any wire whose cross-section remains constant along the length of the wire.
This is generally valid, to a first-order degree, for any wire where the cross-sectional area does not change along its span.