There was a real masked prisoner at La Bastille, but rather than a twin brother, more recent conspiracy theories have him being Louis XIV's biological father. The official story of Louis' conception was that King Louis XIII, long separated from Queen Anne, was going to his hunting lodge and had packed stuff that he would need. It started raining and since the Queen had the only bed suitable for the King they slept together, conceiving the heir. The conspiracy theory is that Cardinal Richelieu convinced the Queen to have an affair with a "sperm donor," who then was sent off to Canada, but later returned to France and tried to extort money for his silence. The motive for the plan was that Richelieu feared that civil war would break out if the King died childless to be succeeded by his foolish brother Gaston. But the sperm donor theory is just hearsay and probably not true. Queen Anne might have had an affair, but she and Richelieu did not work together because they hated each other. Louis XIV also resembled Louis XIII enough to ensure to most people that he was a true biological son.
Alexandre Dumas père, the author of the book for which this is based, adapted his novel on a historical account of a mysterious prisoner in the Bastille who was forced to wear a leather mask on special occasions for the two years between his imprisonment and subsequent death.
Louis XIV did have a brother named Philippe, but he was not a twin. He was several years younger and had the title Duc d'Orleans. In the source novel by Alexandre Dumas père, both Philippe brothers appear as characters, but nearly all film versions leave out Philippe d'Orleans, who isn't necessary to the main plot and would confuse viewers.
Although Louis XIV, who was a real king, is a prominently featured character in the movie, the closing credits state that all characters are fictitious. This statement involves a loophole common to movies of this nature. The film portrayal diverges considerably from authentic descriptions of the real person, so the character is fictitious in the sense that the words and actions of the character are not claimed to be things that the real person said and did.
This film is one of the few, if not only film versions, that features the subplot of Louis XIV stealing Rauol's fiancée from him. The story plays out differently, however. Christine was originally Louise de la Valliere, a historical figure who was in fact Louis's mistress, and according to some document had previously been involved with a man called Bragelonne, on whom Raoul was based. However, in the book Louis does not immediately send Raoul to Africa to be killed. He is instead sent to England on a diplomatic mission, and is recalled only when Louis's previous lover, Princess Henrietta (his brother's wife) calls him back. It is well after the failed attempt to replace Louis with Philippe, and after he realizes that Louise loves Louis in return, that a heartbroken Raoul accepts a position with the King's cousin, Beaufort, in Africa, where he is killed.
Although the book is often published under the title The Man in the Iron Mask, Philippe is not made to wear the mask throughout the book. Though he is imprisoned in the Bastille, it is only after the failed attempt to supplant Louis with him that Louis gives the order to have his face covered.
Louis's twin brother is named Philippe. The real Louis XIV did in fact have a younger brother named Philippe, who was a flamboyant homosexual. Dumas's novel does not attempt to replace the historical Philippe with his fictional version however: both are featured in the novel, but often the historical Philippe is left out of film adaptations to avoid confusing the audience with two characters of the same name.
Even though Gabriel Byrne in the role of D'artagnan is supposed to be in character as much younger than the older Musketeers, Byrne, Jeremy Irons, and Gérard Depardieu are in fact almost the same age. Irons and Depardieu were both born in 1948. Byrne was born in 1950. John Malkovich was born in 1953 making him the actual youngest of the four men.
In the original story by Dumas, the motives of Aramis are far less noble than those portrayed in the film. In the story, Aramis plots to replace Louis with Philippe as part of a master plan to have Philippe appoint Aramis as cardinal, leading to an eventual election as Pope. Aramis also has hopes to stack the Louis cabinet with allies leading to further power and a possible appointment of Aramis as prime minister of France.