For those who are using ionic 4, you should use Ionic CSS Utilties for padding
In short, you have to code this:
<ion-item class="ion-no-padding">
<ion-thumbnail>
<img class="imgmg" src="https://stackoverflow.com/questions/49569679/...">
</ion-thumbnail>
<h2>Text</h2>
</ion-item>
If you want to remove inner paddding, use ion-item custom CSS properties:
ion-item {
--padding-end: 0px;
--inner-padding-end: 0px;
// here other custom CSS from documentation
}