Off the top of my head, there's:
Galloping Fanny (1934?) with Cubby the Bear
Porky and Teabiscuit (1942?)
That's all I can think of at the moment...
There's one of Hanna & Barbera's first cartoons called Gallopin' Gals, which coincidentally is a bonus feature on the Day at the Races dvd.
Actually, "Porky And Teabiscuit" was released in 1939. There were also these:
"Talking Horse Sense," Modern Madcaps, Famous Studios, 1959. Oscar Gullible enters Gabby in a race, convincing him to talk to the other horses. Unfortunately, another horse wins, since Gabby forgot how to talk to horses!
"At The Races," The Flintstones, Hanna-Barbera, 1960. Fred and Barney win big at the dinosaur races, but a robber has other ideas. Another episode with a similar plot was "Two Men On A Dinosaur."
"The Million Dollar Derby," Top Cat, Hanna-Barbera, 1961. Top Cat and the gang enter a horse in a race, but this equine only runs when it hears bells and sirens.
"The Winner's Circle," The Jackson 5ive," Rankin-Bass, 1971. The Jacksons enter Horse, AKA Groovy, in a horse race.
"The Addam's Family At The Kentucky Derby," Hanna-Barbera, 1973. The Addamses enter Pugsley's nag in the famous race.
"Just Horsing Around," Shirt Tales, Hanna-Barbera, 1982. The Shirt Tales enter Clyde and Bogey in a horse race-at which Mr. Dinkel just happens to be present.
As for dog racing, the only ones I know of are "The Grey-Hounded Hare," and "Boo Ribbon Winner."