“When a man's best friend is his dog, that dog has a problem.”
“Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.”
This may be original with Groucho, but the Quote Investigator http://quoteinvestigator.com/category/jim-brewer/ mentions the earliest report found in a 1958 issue of Boy's Life magazine where it is attributed to Jim Brewer.
Misattributed
Variant: Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.
Source: The Essential Groucho: Writings For By And About Groucho Marx
Help us to complete the source, original and additional information
Groucho Marx 117
American comedian 1890–1977Related quotes

“In many respects, my best friends were dogs.”
Source: The New Canada (1992), Chapter Two, Transitions, p. 33

" Malcolm X: Make It Plain http://www.pbs.org/wgbh/amex/malcolmx/filmmore/pt.html," from The American Experience, season 6, episode 6, PBS (first aired 26 January 1994)
Attributed

“The dog may be man
Horse, donkey, too
But the bull-
Man can not
Anytime.”
Smriti Shesh (Poetry Collection), Kathyaroop Books, 2002.
Warren G. Bennis; As cited in: Mark Fisher (1991) The millionaire's book of quotations. p. 15
1990s

Source: I Am Legend (1954), Ch. 2
Context: They were strange, the facts about them: their staying inside by day, their avoidance of garlic, their death by stake, their reputed fear of crosses, their supposed dread of mirrors.
Take that last, now. According to legend, they were invisible in mirrors, but he knew that was untrue. As untrue as the belief that they transformed themselves into bats. That was a superstition that logic, plus observation had easily disposed of. ‘It was equally foolish to believe that they could transform themselves into wolves. Without a doubt there were vampire dogs; he had seen and heard them outside his house at night. But they were only dogs.