Murphy was playing a character who was a racist and it was played for a joke.
Foxx was being himself and speaking as himself. From what he’s said in the past I don’t doubt that he believes that it would be cool to kill all of the white people.
Foxx was only playing on the meme that blacks are usually the first ones killed in movies and usually play the buddy or the one that dies early in the film rather than the substantial characters.
He is making the point that it is neat / rare for him to be playing a black guy (that is a hero protagonist) in a movie where the white guys are the bad guys.
Usually it is the white guy as the hero shooting brown people that plays well at the box office (according to him).