Brandi Freeman felt guilty leaving her dog in her Jersey City, N.J., apartment while she went to the gym. So on a recent Saturday morning, the 27-year-old high-school chemistry teacher met a half-dozen other owners and their dogs in Brooklyn’s Prospect Park.

Ms. Freeman sprinted, did squats and raced through an obstacle course set up by the class operator, a company called Go Fetch Run—all with her Shih Tzu, Franklin, panting by her side on a leash.

“He...