It really is mind-scratching when you truly delve into the foils that G.R.R.M has put into place within his books for Daenerys and Cersei as characters. Both of them mirror one another almost perfectly - ranging from their families down to how they handle prophecies and rulership. Cersei even reflects Aerys II, the Mad King, whilst Dany is actively doing things to keep away from that image.
Regarding family - both Daenerys and Cersei have a parallel where they idolize Rhaegar, but they foil in what those idolizations and thoughts about the man actually are-
Cersei thinks Rhaegar as beautiful, handsome, something for her to possess. Something she wanted but could never obtain. She focuses on his aesthetically pleasing qualities over who he was as a person. She believes if she married him, her life would be better, never once questioning on if the match would have been good or not - she falls into delusion regarding Rhaegar. She even gives Aurane Waters a fleet of ships simply because he reminded her of Rhaegar and she thought him beautiful.
Dany, however, thinks of Rhaegar as someone to look up to. She does not care if he is handsome or beautiful, she values who he was as a person. She questions what he would do if he faced the situations she experienced. She thinks of his bravery and wit and kindness. Who he was as a person matters more to her than his looks. She does not fall into beauty or aesthetic pleasure like Cersei does.
Now- even their relationships to their other brothers are foils:
Cersei, being Jaime's twin, views him as the male counterpart to herself. She sees him as being the man she could never be - physically, at least, for she believes herself to be smarter than him. She believes they entered the world together and will leave it together, having a toxic bond between them, one she likes to control mostly. However - her paranoia and increasing delusions/madness is driving Jaime away from her, with him comparing her to the Mad King, and in the end he's run from her and is ignoring her letters. In a prophecy she was given - it is believed Jaime will choke the life from her, though she thinks it will be Tyrion.
Dany and Viserys, however, were clearly much different - Viserys used to be kind to Dany, but grew mad after they sold their mother's crown, and began to abuse her. He was the controller in their relationship, the one who thought he owned her and warned to 'not wake the dragon'. Dany never thought herself above Viserys, thinking him as the rightful heir to the throne and her King and even diminishing herself compared to him in her early chapters (being fearful when she first slapped him, saying she 'hit the dragon'). However, Dany later realizes that she is the one who is the dragon, and Viserys dies threatening her.
Cersei hated Tyrion and abused him, blaming him for the death of their mother Joanna and also believing he will be the one to kill her.
Dany, however, was the one being abused by her brother Viserys as he also blamed her for the death of their mother Rhaella.
Cersei mostly idolizes and compares herself to her Father, Tywin, a horrible man who did cruel things, viewing herself and him as one in the same.
Dany, however, idolizes Rhaegar - who was viewed as good, kind, and a fierce warrior who loved the people he was meant to rule. She does not believe her and Rhaegar as one in the same at the delusional capacity like Cersei, but is constantly told and shown that she and Rhaegar are alike.
A major difference/foil between Dany and Cersei are their views on feminism and how they act towards other women and view themselves as women-
Cersei hates being a woman and hates her own femininity. She is always wishing she was born a man, she sees Jaime as the male version of herself, and she even thinks "I am the only true son he [Tywin] ever had". Cersei sees being a woman as a weakness. She is internally misogynistic. Instead of uplifting and caring for and supporting other women she views them with jealousy, suspicion, and hatred. She would not care if another woman was abused or raped if it got her what she wanted.
Dany, however, enjoys her own femininity and does not run from or shun it. She takes strength in being a woman. When Razdal mo Eraz calls her a woman as insult, Dany replies with: "Woman? Is that meant to insult me? I would return the slap if I took you for a man". Dany supports other woman, cares for them, and tries to save them when she can. She gains power to protect these women from their abusers, comparing herself to them from her time as a bridal slave to Drogo. She likes girly things and doesn't think of herself as a man - when she sees herself as Rhaegar in black armor, it is not a man she sees, but a woman subverting gender roles by being in a man's place when society would deem otherwise. She would stand against anyone to protect women and feminism in a world that is misogynistic.
How they treat other women:
Cersei is vile and vicious towards other women, especially when jealous. She killed her best friend, Melara Hetherspoon, by pushing the girl down a well for wanting to marry Jaime. She hated Elia Martell for marrying Rhaegar and she hated Lyanna Stark for being a woman Rhaegar chose to run off with and loved. She also hated Lyanna due to Robert always yearning and grieving over Lyanna their entire marriage. Cersei was disdainful towards Sansa - manipulating Sansa to go against her own father, telling Sansa to use sexuality as a weapon, holding Sansa hostage, allowing Joffrey to abuse Sansa, relishing in Tyrion marrying Sansa, blaming Sansa for Joffrey's death, etc. She hated and threatened Margaery, seeing her as a rival and threat. Cersei also rapes her own handmaiden, Taena, trying to reenact what Robert did to her and get pleasure from it- she even uses mysognistic/sexist language in her thoughts of Taena, describing Taena's genitalia as a "Myrish swamp" and thinking about "goring" the woman - Taena even says Cersei was hurting her; Cersei was intentionally assaulting Taena the same way Robert used to assault her, because she was trying to understand what pleasure he got from it to see if she could get that pleasure for herself.
Dany is kind and caring towards other women, on the other hand. She compliments and uplifts other women, tries to care for them, and protects them. She tried to protect Doreah from Viserys' anger, she tried protecting the Lhazareen women from being raped by Drogo's men, she freed and actively protected slave women, she treats Missandei with care and respect and protects her, she is kind to her female opposition (such as the Green Grace), she never acts from jealousy or hatred towards other women. She views Elia Martell with pity and sadness, and she also thinks Lyanna must have been quite the woman to gain Rhaegar's eye - not diminishing either one, but seeing them in facets and recognizing both were good women that didn't deserve their fates. Women (especially little girls) view Dany as Mother, and some women even ask Dany to name their babes for them, showing deep devotion and love; Dany also acts like a Mother to Missandei. Dany, when she sleeps with Irri, does not force Irri into the act nor hurt Irri; people like to say Dany raped Irri, but people forget that Irri woke to Dany pleasuring herself and decided to pleasure Dany of her own volition. When it happens again, Dany tries to express that Irri is a free woman and does not HAVE to pleaure her, but Irri expresses that she considers it 'an honor to help'; even after that, Dany stops sleeping with Irri and beds Daario instead and never once considers harming Irri, forcing herself on Irri, hurting Irri, and she never once thinks misogynistic/sexist thoughts about Irri during the act like Cersei would.
How they view the Smallfolk and Rulership:
Cersei views the small folk with intense contempt, hatred, and thinks herself highly above them. She thinks the best way to manage them is through fear. Her ego is high, making her believe she is superior to the peasants and in her mind they are expendable so long as it serves her/her agendas. She dismisses their needs, opinions, and livelihoods . Her paranoia and delusions lead her into seeing threats everywhere which include the smallfolk. She disdains how Margaery treated the smallfolk in aim of gaining their love, and believes in only harsh and brutal control. She is heavily narcissistic and condescending when it comes to the people she considers below her, and would shut the gates to those starving or in need of help.
Dany views the smallfolk/the freedman she rules over as her children in contrast to Cersei. She treats them with love and affection and tries to do right by them. She hates to see them in pain or suffering and tries her best to care for the people she rules over and protect them. She has a gentle heart regarding the smallfolk, as said by Ser Jorah himself; she also gets compared to Rhaegar, whom was loved by the smallfolk. Dany tries her best for those she rules over, even if it brings her struggles, such as the sick and dying gathering outside Meereen's walls and her going out to personally care for them and being frustrated that she can't do more for them - showing she would not drive out or ignore those in need. Dany understands her peoples needs and has them see her or goes to them personally to help them and ask of their opinions and tries to change their lives for the better. Even if it does not bring her power or suit her agenda, Dany would go out of her way for the smallfolk, and even thinks of filling Kings Landing with happy people were she Queen and riding through the streets just to see them smile, not wanting to harm them as she's "supped on enough tears".
Both address ruling as Queens differently-
Cersei when given a position of power makes many mistakes and carries deep delusion and paranoia, which will eventually lead to her own downfall. She leads through fear, domination, and lets her narcissism cloud her thoughts/judgement. She tries to emulate her father, Tywin, though she clearly has a lack of his intelligence, foresight, and ability for strategy. Her decisions are led by her ego and delusions/temperament over tact, which has led into her alienating allies and falling into manipulation (Aurane Waters for example). She is ruthless, but carries no wisdom and is severely impatient, leading into her consistently making mistakes that will cripple her own reign. Cersei lacks everything that makes a good ruler, and that will lead into her own downfall, as the more she tries escaping her fate the more she ties herself into it.
Dany, when given power, does make mistakes - but it is not done out of malice or a lack of wit. She learns from each mistake she makes, and does her best to fix them. She rethinks over her decisions and constantly questions herself and wonders if she's made the right choices. Dany does not allow paranoia to get to her, proven when she respects and is kind to Quentyn Martell despite being told not to trust him by Quaithe. Dany carries intelligence, has foresight, and is able to effectively strategize. Her decisions are led by what she thinks is best for her people even if she doesn't personally like/agree with it (Ex: her wearing tokars, reopening the fighting pits, marrying Hizdahr, and accepting the Green Grace as part of her council to keep peace in Meereen). Whilst she has enemies, she also makes allies, and knows that blindly trusting anyone is as foolish as trusting no one which makes her think more balanced/pragmatically when ruling. She is merciful, ruthless when need be to her enemies (slavers), is patient, and enjoys seeing her subjects happy.
How they address Prophecy:
When given a prophecy by Maggy the Frog about her own downfall, Cersei is fearful yet also arrogant. She is constantly suspicious of others she believes will fit the prophecy, and allows her own paranoia to delude her into making enemies out of anyone she suspects. She hates/abuses Tyrion thinking he will be the one to kill her, she is vicious towards girls like Sansa and Margaery as she suspects them them to be the younger, more beautiful Queen's who will cast her down. Her trying to prevent the prophecy is what will carry the prophecy out and lead to Cersei's own downfall - a common theme in G.R.R.M's own work. Her blaming Tyrion for Joffrey's death and obsessing over it isolates her permanently from Jaime, Cersei suspecting Margaery and having her arrested led into Cersei's own arrest and her walk of atonement from the High Sparrow whom she put into power herself. She is orchestrating her own fall from power by trying to go against prophecy, which she is misconstruing entirely.
Dany, however, addresses prophecy entirely different from Cersei. When told she will face three treasons by the Warlocks in HOTU "once for blood, once for gold, and once for love", she questions and analyzes potential suspects actions only after they happen to see if they fit what the prophecy describes- she only makes guesses, and knows she can't for sure pinpoint what the prophecy could mean, and constantly doubts over the matter. When told by Mirri Maz Duur she can never have a child again, Dany never tries to use/find her own magic to break this curse or go against it, and instead accepts it; she thinks she will never have living children again, doesn't attempt to do so, and considers her dragons and the people she rules over as her children instead to fill that ache. When told by Quaithe not to trust certain people, Dany may be suspicious of those she comes across, but she still treats them with kindness and respect and welcomes them and continues to rule based on her own morals/values rather than falling into paranoia/delusion; she does not try to alienate potential allies nor does she trust anyone too blindly. Dany takes prophecy in stride and does not try to work against it, thus she is not orchestrating her own downfall; she is also one of the first few characters in ASOIAF to not misconstrue prophecy or try to enact it out/go against it like many others have in the world which led to their own downfalls.
Cersei has a strong connection to fire, but her foil to Dany is in the way she parallels Aerys II in her use of it, particularly Wildfire. She burns the Tower of the Hand, trying to burn out her delusions of Tyrion. She finds a sensual pleasure in the destruction caused by the fire, mirroring how Aerys II would become "aroused" when watching his own victims burn. Cersei uses fire in a volatile manner; she burns the Tower of the Hand out of fear of Tyrion being in the walls over any real purpose. Jaime, when seeing her look at fire, compares her look to the one Aerys II would have when burning people alive. Cersei revels in destruction and will grasp to any power she can get - even if it means using fire to get it. Cersei is the one who would willingly burn down Kings Landing just to keep herself in power, like Aerys II. It is highly likely that when Young Griff begins his invasion, Cersei will be inclined to (or will definitely) use Wildfire hidden around the city to burn it all down in hopes of taking him down with it.
Dany, however, transforms with fire. She uses it to bring life, her dragons, into the world. She dreams of Drogon breathing fire down upon her and it makes her feel "strong and new and fierce"; she uses fire to 'cleanse' herself, and becomes stronger from it. Dany's relationship to fire is more instinctual and magical, she views fire with beauty, not destruction. Dany uses fire as a sign of Freedom - not cruelty or punishment. She uses fire to break the chains off slaves and to empower them. She is the passion, love, and ardor G.R.R.M speaks about when describing Fire vs. Ice in his interviews. Unlike Cersei, Dany wants to use her fire to protect the innocent. Her fire comes as justice, and liberation, not destruction. Dany even thinks to herself that she "has no wish to reduce Kings Landing to a blackened ruin full of unquiet ghosts". When she uses fire, she uses it in a way like Azor Ahai (Ex: my post of Daenerys' parallels to Azor Ahai here).
I think it's pretty obvious who the Mad Queen of these two is, and it's definitely not Dany :). It's really fun delving into these two as characters and exploring how much they contrast as foils with G.R.R.M's writing. He wanted to depict two versions of women approaching rulership and power in a male-dominated world and their clear differences and I think he did an amazing job at it.