The dog had to have an emergency operation to cut open its stomach