Why do dry sodium chloride and the solutions of sodium nitrate and sodium chloride all impart the same color to the flame?
You are seeing the spectrum produced by sodium ions, which is the same regardless to the source in which the ion is found.
Every element has its own particular spectrum of colours that the atoms or ions will emit when energy (in this case heat) is supplied. When you heat the salt containing the sodium ions, the movement of the electrons in the energy levels of the ions cause the release of light photons with frequencies that depend only on the element involved, and not on the particular salt of which it is part. So, the sodium in sodium chloride, sodium nitrate, etc all produce the same bright yellow colour that is a characteristic of sodium.
Some spectra are seen in the diagram below: