Are the monsters in the 5e MM actually following the monster creation rules in the 5e DMG?
Short answer: No.
Longer answer:
Paul Hughes, of blogofholding, has written a series of blog posts investigating this particular question. His approach was one of doing a statistical analysis of all the monsters in the MM (and some other books). He arrived at several significant findings:
Paul also references an interview by Mike Shea (aka Sly Flourish) of D&D lead rules designer Jeremy Crawford about monster design:
Mike asked Jeremy about the table in the DMG for homebrewing monsters. Jeremy provided this interesting fact: apparently, the canonical formula for determining monster CR is encoded in an internally-used Excel spreadsheet. (We’ve seen this spreadsheet in action in the Mike Mearls Happy Fun Hour.) The table in the DMG was made after the spreadsheet, and was an attempt to reverse-engineer and simplify the spreadsheet’s formulas for DM’s home use: it’s not used as part of the process for creating for-publication monsters.
So, what are the more accurate rules?
Paul has summarised his findings in a reverse-engineered set of 5e monster creation rules that more closely mirrors the results apparent in the MM et al. He has both a one-page set, and a two-sides-of-a-business-card summary.
Aside from the specific changes that the Animal Companion feature makes to the wolf, it retains its statistics from the Monster Manual, so it begins with 11 hit points.
Per the class feature as described in Unearthed Arcana: The Ranger, Revised:
For each level you gain after 3rd, your animal companion gains an additional hit die and increases its hit points accordingly.
This works like any hit die. The wolf's hit die is a d8. When you level up beyond 3rd level, roll 1d8 + 1 (CON) and add it to the wolf's current hit point total to determine the new hit point total, bringing it to (3d8 + 3).
Alternatively, take the average value. Per DMG p. 276, the average for a Medium size creature is 4.5 HP per die on a d8. The wolf's new HP value is 17 (3d8 + 3).
If you increase the wolf's Constitution score when you receive an Ability Score Improvement, be sure that you update the wolf's HP total to account for the new modifier.
The formula for HP is: $$n\text{d}X + (n \times\text{CON})$$
where \$n\$ is number of hit dice and \$X\$ is the hit die value.
I have included both the option to roll for the new hit die or use the monster average because it is up to your DM to decide the method. Traditionally, taking the average is the approach used for NPCs and monsters, including animal companions.
Best Answer
Give it levels in a class for the purpose of determining hit dice.
This can also be raised up to whatever maximum of levels you need, and the hit dice can also be whatever makes sense. The highest monster in the MM is the Tarrasque with 30d20 hit points, and 30 Constitution.
Or... calculate the average amount of damage your party deals per turn, and scale the difficulty based on how many rounds you want the combat to last.
The longer the combat, the harder it is for the adventurers to fight. Say that given all attacks hit (calculating AC is outside the scope of this question), your adventurer party deal a given amount of damage a round on average in total. You would multiply said given amount of damage by how long you want the encounter to last in rounds (based on your party's total hit points and how many hit points of damage your monster deals on average given it hits). If you want to even more accurately do this, calculate the probability both the party and the monster hit their attacks given their average AC.
Or... make it up, and using trial and error see what works and what doesn't.
Do make sure not to slaughter the party if you decide to take this approach.
As for the last part of your question... the Challenge Rating has no direct correlation to hitpoints. Rather, it is a combination of features of the monster including hit points, AC etc. For example, a monster could be fairly weak by first looking at just its AC, hitpoints and damage, but it could have other features which make it very difficult to fight.