Q:

Why do most frameworks use margin and not padding on p, h1, h2 etc.?

Would there be any downside to use padding? Or why everyone seems to go with margin?

A:

There's no downside to using either, because padding and margin are two different things and they are used to achieve different effects. Without a background these rules may seem to do visually the same thing, but each add spacing in different places.
Padding
Padding adds spacing inside the element - between the border of the element and its content. It's used so the content of the element wouldn't be right next to the edge of the element (or its border).
Margin
Margin adds spacing outside the element itself. It specifies how much space there should be between the element and surrounding elements. 
Other differences:

Margin-top and margin-bottom will always collapse, I.E. two elements with margin-top:15px and maragin-bottom:10px will have a distance of 15px from each other. The padding rule doesn't care what the padding of other elements is and will never collapse.
Margins can also be used to make elements overlap by using negative values. Negative padding isn't valid and won't do anything.
Margin is always transparent and can't have a background. The background is, however, painted on the padding (unless you use the background-origin: content-box rule, which paints the background only inside the element's content). 
Margin can be used to center elements using the value auto on both margin-left and margin-right. Padding can't be auto.

Run the snippet below to see the difference in action:

div{
  background: #B4D455;
  width: 100px;
}
div:nth-of-type(2n){
  background: #D4B055;  
}

.padding{
  padding: 10px;  
}

.margin{
  margin: 10px;  
}
<h3>None</h3>
<div>content</div>
<div>content</div>
<div>content</div>

<h3>padding:10px;</h3>
<div class="padding">content</div>
<div class="padding">content</div>
<div class="padding">content</div>

<h3>margin:10px;</h3>
<div class="margin">content</div>
<div class="margin">content</div>
<div class="margin">content</div>

<h3>margin:10px; and padding:10px;</h3>
<div class="padding margin">content</div>
<div class="padding margin">content</div>
<div class="padding margin">content</div>

