Is 18-gauge wire sold as lamp cord sufficient for replacing the cord on a vintage toaster marked 6 amps?
Electrically that would be fine, but possibly not thermally.  Most toasters I've seen have cords marked that they're special high temperature wiring.  I believe this is needed because the heat from the elements will conduct back along the cord (copper is a great conductor of heat as well as electricity), and it's important for the insulation not to melt.  It looks like the term to search for is &quot;HPN cord&quot;
Here's some examples of cords that are listed for high heat applications:
https://www.acehardware.com/departments/lighting-and-electrical/extension-cords-and-power-strips/power-cords/30127
https://www.amazon.com/Power-cord-Heaters-Irons-Hardwired/dp/B000A8LL82