Nurul Islam, who was wearing a school sweatshirt which all have teachers' last names on them outside the Coach and Horses near Hertford last week, was told by a barman to remove his jumper and claimed it was offending people because of the Nice attack.
"A staff member came outside and asked if I could I take off my jumper because it was making some customers feel uncomfortable 'after what happened last night'," said Islam, a technology teacher at the Thomas Alleyne Academy.
Islam was waiting for a group of pupils from the Academy in Hertfordshire, who were on a Duke of Edinburgh assignment and the pub was the agreed meeting point.
"I was being discriminated against because of my surname so I was left really upset after the incident. We all have surnames on the backs of our hoodies, which is the responsible thing to do," said Islam, who helps run the school's Duke of Edinburgh award scheme.
A police hate crime officer is investigating the incident.
"A specialist hate crime officer is investigating to establish whether offences have been committed," Hertfordshire Police said. The pub, however, has not commented on the issue.