@Gymrabbit I actually work in an international school, with children from pretty much every country in the world, so most of them are immigrants! As such, I have students with wildly differing experiences and viewpoints on all manner of topics due to the political, religious, cultural and historical environments they have been exposed to. In one of my classes currently, I have Ukrainian and Russian children sitting next to each other. In another, I have several Israeli children and a Palestinian. So what would be a 'contentious' view in a UK classroom filled with largely white British children is actually far more nuanced in a classroom filled with children from all over the world. A conversation about terrorism and immigration is not such a straightforward conversation to have when you perceive a group of people living in your country to be both illegal immigrants and terrorists, is it?
I therefore don't consider the statement immigrants are terrorists to be racist, because for some children I teach, it's simply a fact as far as their life experience has taught them. I consider it to be a contentious viewpoint that may be informed by personal experience, that is worthy of respectful discussion. For my students, if that view had been raised in my classroom, I would gently remind the class that for most of them, they are actually immigrants to the UK. So if all immigrants are terrorists, that would make most of them terrorists too. How do they feel about that statement now? And then go from there. Having a refugee in your classroom shouldn't make any difference. Many children will have grandparents or parents who were immigrants if they are not immigrants themselves. Having the chance to explore and talk about that to help the child who views immigrants as terrorists to see that immigrants are just ordinary people like them looking for a better life somewhere else, will be much more truly educational and transformative than shouting at them or telling them they're racist. We shouldn't shy away from having difficult conversations in our classrooms.
I wouldn't really be happy to label any child's views as being racist, homophobic, etc. I don't think most young people have enough knowledge or experience of the world to have formed deliberately discriminatory views. They are merely parroting what they have heard elsewhere, or speaking from personal experience. So having discussions allows their experience to be developed and challenged in a way that helps them see new ways of thinking, rather than being shouted at and shut down.
As for your comment about teachers being whores, I can't ever imagine a scenario where that would come up. If it did, yes, I would treat it in exactly the same way I would any other problematic statement. Repeat it, and ask why they think that. A child saying 'teachers are whores' is probably looking for a very different response to a child saying something about immigrants and terrorists. That's an overtly attention seeking statement that I wouldn't want to gratify by getting upset or making a big deal out of.