Is it possible for an animal companion to gain the constrict ability, if they don't naturally start with it or gain it at level 4 or 7? Are there any feats, items, or any other means of acquiring this ability?
Yes, it's possible
Both the Backbreaker's Mail and the Anaconda's Coils will grant constrict to the wearer and are items that can be used by animal companions. There are other items, such as the Constrictor Gauntlets, but they require certain actions or body slots that may not be available for animals.
Note that the armor is usually shaped for humanoids, so you might need a blacksmith to suit it to your companion's body (also, ask your GM if he allows that).
The polymorph subschool spells will all grant the constrict ability if the form assumed has it. But these spells may not be easily accessible to your character depending on his class, as they are mostly available to alchemists, bloodragers, magi, sorcerers and wizards. While Vermin Shape is also available to druids and witches.
Although it is not exactly constrict, the result of the spell Vine Strike is similar to the constrict ability: an additional 1d6 damage, target is entangled if they fail a reflex save. Being personal, most classes with an animal companion will allow you to cast this on the companion.