The problem isn’t nitrates and nitrites themselves though, but rather what’s present when they’re digested. Something has to convert nitrates to nitrites, or you need to consume nitrites, then something has to activate the nitrites into something harmful.
With meat, the presence of haem for example allows for the formation of a type of N-nitroso compound (nitrosylated-haem in this case) which is cancer-causing. Vegetables don’t tend to come with such compounds, but actually come with compounds which inhibit the development of harmful nitrite-based compounds. Most of these are antioxidants.
This doesn’t mean it’s impossible for vegetable-derived nitrites to harm you. It’s just far, far less likely.
Fried meat that was previously cured is by far the most dangerous source of these cancer-causing compounds. The most well known example is probably bacon.
edit: need=use
The flavour profiles are different, and the limits for consumption are much different as well. Too much of both is dangerous, but too much NaNO3 is arguably easier to reach and more harmful in the short and long term. NaNO3 can lead to immediate issues with hemoglobin production for example. In the longer term, high volumes are carcinogenic.
Your primary concern with NaCl is managing safe blood pressure in the longer term, and in the shorter term, it's relatively easy to avoid toxicity or other more minor complications like dehydration.