Mostly no. The great majority of pets are cosmetic companions that follow you around and never swing at anything. A small handful, such as the Oblivion Blade pet and the Dark Dragon of Destiny pet, do deal damage in combat.
More commonly, pets provide passive bonuses instead of attacks. Crit-chance boosts are a popular example, and those can be far more valuable in a long grind than a pet that chips in a few points of damage now and then.