Q:

Do the rules for carrying capacity apply to animal companions?

Imagine a Ranger Beast Master with a Hawk animal companion. 
A player wants their helpful hawk to carry gear for the party.
The hawk wears a specially made harness with a pack dangling from it for characters to take gear from.
The carrying rules stipulate a capacity of Strength score times 15 in pounds. Half this number in the case of a Hawk which is tiny. 
Since the Hawks Strength is 5, can it carry a backpack (5lbs) filled with 30lbs of gear?

(5 STR x 15) / 2 = 35 lbs

A different example might be a wolf, carry capacity of 180 lbs?

(12 STR x 15) = 180 lbs

A:

Yes, the rule for calculating carrying capacity applies to all creatures.
If the rule only applied to PCs, then there would be no reason for the rule to specify how carrying capacity is calculated for creatures of sizes other than Small or Medium. But the rule (found in the Using Ability Scores section of the Basic Rules or Player's Handbook) does specify how carrying capacity is calculated for creatures of all sizes:

Larger creatures can bear more weight, whereas Tiny creatures can
  carry less. For each size category above Medium, double the creature's
  carrying capacity and the amount it can push, drag, or lift. For a
  Tiny creature, halve these weights.

In the Equipment section of the Basic Rules or Player's Handbook, the carrying capacities for several creatures that can be used as mounts are listed. In every case, these values match the expected calculation using the carrying capacity rule given above.
For example, the mastiff, which is a Medium creature, has a stated carrying capacity of 195 lbs. This is 15 times its Strength score of 13. The warhorse, which is a Large creature, has a stated carrying capacity of 540 lbs. This is 15 times its Strength score of 18, doubled.
Therefore, to calculate a hawk's carrying capacity, we take 15 times its Strength score of 5, which is 75. Then we half that because the Hawk is a Tiny creature, which gives us a result of 37.5. Unless otherwise specified, we round down, so the hawk's carrying capacity is 37 lbs.

