Throughout history, people have always become emotionally attached to animals they've taken into their homes. Humans are empathetic creatures so it’s not odd for us to develop feelings the people and the animals we show care towards. We see theses emotional connections all the time in stories and the media. Dogs though are merely tools for many people that have a job to do. Fish are a type of pet people own yet still eat. While people may argue there's a less emotional attachment with fish, the concept is the same. There is no defining factor for when an animal becomes food instead of a friend.
For Western cultures, there's a heavier distinction between friends and food due to pet culture, but for people who rely on the income their livestock brings, that line is easier to blur. A dog is just an animal for many cultures across the planet. While some might find such things cruel, it's no different than raising piglets to become pork on the dinner table.