I found
this article at Amazon Kindle Direct Publishing help, maybe this is why margins are not displayed properly.
Margins
At this time, Amazon KDP doesn't support margins set inside CSS/HTML (such as topmargin, leftmargin etc. set in px values). You can use the CSS margin attribute, but depending on your text format, this might not translate properly. Note: You can set only the left, top, and bottom margins this way, never the right margin.