How to get a pennant (Diablo 3)

Pennants in Diablo 3 are cosmetic-only items that you can carry on the back of your character. Once you unlock a pennant, it is useable by any character in either normal, seasonal or hardcore mode.
There are currently 5 different sources for obtaining pennants, but more pennants and pennant sources will probably be added in new patches.

1) Ascendant Pennants:

These pennants are awarded for completing all set dungeons with any class. Each complete class will give you one pennant, which means a total of six pennants.

2) Mastery Pennants:

These pennants are awarded for getting the Mastery rank in all of the set dungeons of a certain class. As with the Ascendant Pennants, there are one for each class.

3) Pre-order, event and Collector's Edition Pennants: 

There are currently three pennants of this category, the Heroes of the Storm Pennant which is awarded for reaching level 12 in HoTS, The Blizzcon 2015 Pennant and the Grimpola Warsong Pennant (awarded for pre-ordering the Digital Delux or Collector's Edition of Warlords of Draenor.

4) Seasonal Pennants:

Some Season rewards include pennants, and currently there are two of these. The Season 3 Pennant which was awarded for playing in season 3, and the Samhain which was awarded for completing the season journey in season 6.

5) Other Pennants:

There is a pennant known as Harvest which is available in-game, but no one has yet to obtain one. It might be dropped by a mob named Graw the Herald, but that is only a theory at the moment. You can read more about possible drop locations for Harvest by clicking here.