As I'm sure some of you have figured out by now, the portrayal of Margaret Tudor's story in the Showtime series is NOT the same as the life of the real Margaret Tudor. In the series, the story is basically that of Mary Tudor (Henry VIII's sister), but my guess is that they decided to use Margaret's name to avoid any confusion with the other Mary Tudor (Henry VIII's daughter).
Since the series started out in 1520 when Francis I was already King of France, they couldn't fit the real marriage saga of Mary Tudor into the series timeline as it actually happened in history. In reality Mary married Louix XII of France in 1514 and he died a few months later in 1515 and was succeeded by Francis I. Since this all took place before the time that the series started (1520), they moved it to a later year and used the King of Portugal instead of the King of France. Mary (or Margaret, in the series) does later marry Charles Brandon and they are the grandparents of the ill-fated Lady Jane Grey.
The real Margaret Tudor was married to James IV of Scotland (and had two marriages after that) and was the mother of James V of Scotland, who in turn was the father of Mary Queen of Scots. Margaret's great-grandson was James VI of Scotland, who became James I of England after the death of Elizabeth I. So, as you can see, Margaret's real story is very different from that of the character with that name in the Showtime series.
Now, to complicate things even further, the character biographies on the Showtime series website give the history of the REAL characters, which will be quite confusing to anyone who reads them and is watching the series (and seeing a different story!).