Yes, you increase Animal Companion's ability score when advancing it by HD.
The rules for Animal Companion bonus HD state explicitly which benefits it receives as normal for advancing a monster's Hit Dice. That allows to conclude, following the logic of the D&D system, that other benefits are not gained as normal, and therefore size and ability scores are not increased per bonus Animal Companion HD.
However, this article explicitly says that Animal Companions advance as normal per HD, except size. This raises a question of source precedence, and as for me, the mentioned WotC article specifically regarding Animal Companions is a primary source.
A quote from the article in question, for convenience:
Bonus Hit Dice.
The animal companion gains extra Hit Dice as noted in the table on page 36 of the Player's Handbook. The companion gains the full benefit from increased Hit Dice, including increased base attack, base saves, skill points, and feats. The animal companion, however, does not increase in size (any more than you do when adding Hit Dice for your class levels).
Note: Pathfinder Druid has this covered.
Best Answer
Let's take a look at what the SRD says about animal companions:
So in the case of a riding dog, you'd use the creature stats provided in its entry. Talk with your DM whether they'll let you roll its HP using the Hit Dice entry or require you to take the average value listed in parentheses. Take note of any special rules listed for the animal — a riding dog can make trip attacks like wolves, and it gets a bonus to Survival checks when tracking by scent.
As you level up as a druid, your animal companion gets stronger according to the animal companion progression table. Natural armor, Strength/Dexterity scores, and bonus tricks should be fairly straightforward since you're adding a flat value, but bonus Hit Dice is more complex since it affects more things. The descriptions under the table summarize this fairly well, but you can get more specifics from the section for improving monsters. Note that the section about size increases doesn't apply to animal companions.
Remember to apply bonuses for each HD your animal companion gets — that includes more HP and skill points. Creatures get a new feat for every 3 HD they have and an ability score increase for every 4 HD, just like PCs. Since a riding dog already has 2 HD, at druid level 3 it jumps right up to 4 HD, giving it both a feat and an ability score increase.
Also, at higher levels druids get access to new kinds of animals from the list of Alternative Animal Companions. If you go this route, talk with your DM to figure out how your PC can go about acquiring one, but keep in mind that it lowers your effective druid level for determining animal companion bonuses.