Are "sir" and "madam" considered old-fashioned in spoken English in the US? Do native speakers use these words to address their teacher, boss, or customer in conversations?
Customer - Yes. A shop clerk usually doesn't know the name of the customer. Using "sir" is a polite way to address a customer
Teacher - Perhaps. It depends on the culture of the school. It is also common to use Mr or Ms with the teacher's last name. It is common at High School but rarer at university, though you may use "Professor". It is also more rarely used in grade school, in which you have one class teacher referred to as Mr/Ms/Miss...
Boss - Unlikely. It depends on the culture of the office, but usually you would know your boss's name and use that. And depending on the office culture you would probably use first names most often.
Learners tend to overuse "sir" and "madam". In many situations a learner should use the person's name (with Mr/Ms+surname for formality).
The words sir and ma'am are quite common in the US. Ma'am is the way we usually pronounce madam and has been for a long time. Most Americans are surprised to learn they are the same word.
If you are being polite, you will use sir to address any unfamiliar man over the age of 18 or so. You will use miss to address any unfamiliar woman between roughly 13 and 30. You will address any unfamiliar woman as ma'am who seems to be married or over the age of 40 or so. There is no clear dividing line, and we are often offended or confused when the woman is 30-50. In person, if we err on the side of caution, we are likely to to use miss. On the telephone, we usually say ma'am.
A cashier will address most customers as sir and ma'am.
A student should address most teachers as sir or ma'am. They don't always do so. They also use the Mr./Miss/Mrs + surname pattern.
Employees address bosses as sir or ma'am until they have been told otherwise. Mr./Miss/Mrs + surname is the norm in conversation, but you will normally say Yes, sir not, Yes, Mr. Peterson—unless that is the company culture.
By convention, female restaurant servers are addressed as miss.
In a fancy, high-priced restaurant, a female customer might be addressed as madam.
Some people still address letters to strangers in this way: Dear sir or madam, especially when sending a letter of job application. I personally find this absurd.