On teaching a wolf tricks
This falls under the description of Handle Animal.
To make a wolf ride-able, the creature must most likely be reared. Wolves are wild.
Rear a Wild Animal
To rear an animal means to raise a wild creature from infancy so that it becomes domesticated. A handler can rear as many as three creatures of the same kind at once.
A successfully domesticated animal can be taught tricks at the same time it’s being raised, or it can be taught as a domesticated animal later.
During this time, you also train it in combat riding. Succeed on a few checks (DC 17 to rear, DC 20 to train), and you have a now-domesticated wolf that knows the tricks of "attack, come, defend, down, guard, and heel".
Then you hug and play with the thing until it becomes your animal companion. This teaches it an additional trick, which could be any trick you want.
As for whether you can use this bonus trick to teach it a whole new purpose - no. A purpose is just a selection of tricks, combined into one Handle Animal check for convenience. It does not give a discount on the number of tricks required for the whole package, just the number of checks.
On riding a wolf
The questions of whether you take a -5 on riding checks and need an exotic saddle is something that isn't addressed in the game, at least not directly. You will have to ask your DM.
To me personally, wolves and riding dogs look very similar. We also know from real life how physically similar wolves are to large dogs. I can't imagine one being physically well suited to riding and the other not, or them requiring very different saddles. I'd say once you have successfully reared the wolf into domestication, you're good to go.
With the extremely obscure feat: "Mighty Steed". Found in the mount handbook, the handbook states:
Mighty Steed: A feat found in the Dragonlance supplements Bestiary of Krynn and Knightly Orders of Ansalon. A mount with this feat counts as one size category larger for determining carrying capacity and the minimum size of its rider. That is, it lets a Medium character ride a Medium mount, and lets a kobold with Slight Build ride a pseudodragon.
The undersized mount feat (for the rider) is found in pathfinder and does a similar thing.
Best Answer
No. Dwarves and riding dogs are the same size, therefore are not compatible.
According to Rules of the Game:
This is also on page 204 of the Dungeon Master's Guide:
Riding Dogs are Size/Type: Medium/Animal
Dwarves are Size/Type: Medium/Humanoid (Dwarf)