Intrinsically, an ant, or a fly, wants to live just like pigs or dogs. It's ok to kill ants and flies because it is socially approved by the majority of humans around you. In some communities in china, it's ok to kill dogs for eating them, so a person would feel ok doing it. The animal doesn't matter at all, only the opinion of humans around you. As it happens, lighting dogs on fire is not widely accepted, and killing pigs for food is. It's the culture that matters.
A pig wants to live just like a dog does. They want to avoid pain and suffering just like a dog does. They seek comfort just like dogs. The fact that they were bred for a certain human purpose, doesn't change any of that.