I read a story very similar to this when I was a teenager. (It was reprinted in a schoolbook.) I remembered the author as soon as I saw your description, but I had to look up the title.
"Tom Edison's Shaggy Dog," by Kurt Vonnegut, Jr. First printed in the magazine Collier's (March 14, 1953). If you follow the link to the ISFDB listing, you'll see this story has been reprinted many times, most of them being successive editions of a Vonnegut story collection: Welcome to the Monkey House.
The "Shaggy Dog" bit in the title is meant to give us readers fair warning that the entire thing may well be an elaborate joke on the part of the guy telling the story. You see, the major plot points are only being recounted, in dialogue, by one old man talking to another old man as they sit on a park bench in Tampa, Florida.
One man is Harold K. Bullard, accompanied by a Labrador retriever. He loves to talk long and loud to a captive audience, but nobody ever wants to be the captive audience for a second time after they've endured the first experience, so he is always hunting for new victims. The other elderly man is simply referred to as "the stranger," because Bullard has never seen him before, couldn't care less about his name, and never bothers to ask!
The stranger tries to shake Bullard off, but finally seizes control of the conversation by starting to tell a story about something interesting that happened to him when he was a nine-year-old boy, living in Menlo Park, New Jersey, and just happened to be a neighbor to Thomas Alva Edison. This was back when Edison was working hard to find just the right ingredient to put inside a glass bulb in order to get a really practical method of lighting places up with electricity. But in his spare time, Edison had done something else with electricity: He had built a prototype "intelligence analyzer." Hook up some wires to a person's head and a gauge would show how intelligent he was. (Presumably by somehow measuring how much thinking he was doing, and how quickly, in terms of electrical impulses in the brain, although the narrator doesn't go into much technical detail.)
The boy suggests they try it on Edison's dog Sparky. The dog vigorously resists being hooked up to the intelligence analyzer, but the humans persevere. Then they find that the dog's reading goes past a line on the gauge which represents Edison's own intellectual prowess. After checking his analyzer to make sure it isn't broken or something, Edison does some hard thinking and accepts the implications of this startling evidence. I will quote the key passage. (Bear in mind that most of this is dialogue spoken by the stranger as he talks to Bullard, with the "single quotes" marking the bits that are supposedly a word-for-word rendition of what he said, and others said, at the time, several decades earlier.)
"'So!' said Edison to Sparky. ’Man’s best friend, huh? Dumb animal,
"That Sparky was a caution. He pretended not to hear. He scratched
himself and bit fleas and went around growling at ratholes — anything
to get out of looking Edison in the eye.
"'Pretty soft, isn’t it, Sparky?’ said Edison. 'Let somebody else
worry about getting food, building shelters and keeping warm, while
you sleep in front of a fire or go chasing after the girls or raise
hell with the boys. No mortgages, no politics, no war, no work, no
worry. Just wag the old tail or lick a hand, and you’re all taken care
"'Mr. Edison,' I said, 'do you mean to tell me that dogs are smarter
"'Smarter?' said Edison. 'I’ll tell the world! And what have I been
doing for the past year? Slaving to work out a light bulb so dogs can
play at night!'
"'Look, Mr. Edison,' said Sparky, 'why not—'"
"Hold on!" roared Bullard.
"Silence!" shouted the stranger, triumphantly. "'Look, Mr. Edison,'
said Sparky, 'why not keep quiet about this? It’s been working out to
everybody’s satisfaction for hundreds of thousands of years. Let
sleeping dogs lie. You forget all about it, destroy the intelligence
analyzer, and I’ll tell you what to use for a lamp filament.'"
It is also stated that Edison and the kid (the future elderly stranger) both swore a vow of secrecy, and that the kid's payoff was a stock market tip from Sparky which made him independently wealthy for life. But, as I said, we receive no reliable confirmation of any of this, and there is a high probability that the stranger was simply trying to give Bullard a psychological shock. (And perhaps make him suspicious of his own dog!)