The Black Mirror episode "White Christmas" was the one that explored this concept the most. A woman creates a copy of her own consciousness to put into an AI that runs her house. The artificial consciousness is identical to the "real" one, and yet is suddenly dehumanised by its "real self", enslaved and suffers unspeakable psychological torment. A fascinating allegory for how tempting it is to dehumanise other consciousnesses, because it is convenient for us, because they perform a useful role. Not because we don't know better, but we choose NOT to know better. Because that makes our life easier. Dissociating ourselves from the suffering.
Side note: while dogs were treated better than Black people in much of US history, most animals are not treated like dogs. That collective deadening of empathy extends to most animals that we consider "useful" in their role, whether as meat or as labour. It's only because dogs are pets in western society that we allow ourselves to feel empathy for them.
My theory is that it's all too easy for humans to compartmentalise and dissociate from other beings, cutting off our natural inclination for empathy, because of selfishness. Because the "role" performed by that being makes our life easier. Whether that being is a Black person during slavery, a factory worker in South Asia, a cow, a workhorse, a chicken etc.