The difference between domestic animals and livestock, and whether any difference exists, depends on context.
In common usage, livestock refers to specific animals bred in an agricultural setting for food, extraction, or labor. Some consider poultry to be included under livestock; others would treat them as separate. Among laymen in Europe and North America, livestock has a strong association with large mammals, chiefly cattle, horses, sheep, goats, hogs, and mules and donkeys.
Domestic animal, perhaps due to association with household-related terms like domestic appliance or domestic worker, now strongly implies a housepet, especially dogs and cats.
There is additionally the term domesticated animal, indicating animals which have been bred in human company for so long that they are dependent on humans for survival. But not all domesticated animals are domestic (e.g. a dairy cow), and not all domestic animals are domesticated (e.g. a pet snake).
For official purposes, however, the two may be interchangeable: animals which are raised as agricultural or industrial assets. According to the UN Food and Agriculture Organization,
The terms "livestock" and "poultry" are used in a very broad sense,
covering all domestic animals irrespective of their age and location or the purpose of their breeding. Non-domestic animals are excluded from the terms unless they are kept or raised in captivity, in or outside agricultural holdings, including holdings without land.
Livestock or domestic (not necessarily domesticated) animals might include farmed fish, bees, silkworms, or alligators in different parts of the world. Indeed, the U.S. Court of Appeals for the 9th Circuit noted in United States v. Park, 536 F.3d 1058 (9th Cir. 2008) that even dogs could qualify as livestock under U.S. law:
Ron and Mary Park own and operate a dog kennel, Wild River Kennels, on property along the Clearwater River in Idaho. Their property is subject to a scenic easement that was granted to the United States, which prohibits commercial activity but permits livestock farming. In this appeal, we are asked to determine the unusual question whether dogs are “livestock.” Despite a gut inclination that the answer might be “no,” resolution of the issue is not so clear, thus precluding summary judgment at this stage of the proceeding. As it turns out, the term “livestock” is ambiguous at best and much broader than the traditional categories of horses, cattle, sheep, and pigs.