The sentence litterally reads "I want to have a sandwich." which is valid English as well. In Norwegian you cannot use "vil" directly followed by a noun as you do with "want" in English. Think of it as a two word verb: "å ville ha noe" = "to want something".
I think it is slightly rude, but you'll hear it. "Et smørbrød, takk." works, or you could soften it by using the conditional tense "Jeg kunne tenke meg et smørbrød" or by adding a "gjerne": "Jeg vil gjerne ha et smørbrød".
I have always been confused with this, how is the person supposed to know if you mean want or will, for instance, I would like to go there/want to go there sounds fine, but I Will go there sounds aggressive
"Ha" is your verb for "have". In English, that can be implied. However, in Norsk, "vil" is applicable to both "want to" and "will", so you need "ha" to make it work for both. "Jeg vil et..." Or "I will a..." Doesn't quite make sense.