It is difficult to pinpoint exactly who the first people were, as domestication happened over long periods and across regions.
Goats
Earliest evidence dates back around 10,000 years ago in the Zagros Mountains of Iran and possibly the Levant. Early herders were likely hunter-gatherers keeping goats for milk, meat, and fiber.
Dogs
Domestic dogs likely emerged from wolf ancestors 15,000 to 40,000 years ago, with early evidence in Europe and East Asia. Domestication likely occurred independently in multiple locations. Early tamers were likely hunter-gatherers partnering with wolves for protection or hunting help.
Summary
Goat domestication happened around 10,000 years ago; dog domestication happened 15,000 to 40,000 years ago, both by hunter-gatherers.