There's some room for dispute here. Once you have (again, and not for the last time) disqualified The Historian on the grounds of being set in too many countries, the top-ranked book ostensibly set in Hungary on LibraryThing is also the most tagged as "Hungary" on both LibraryThing and Goodreads. I confess I hadn't heard of it. It is a 1942 novel about an elderly general who invites an old friend - who has reappeared after a long absence - for dinner, expressing a certain nostalgia for the old days of the Empire. This is by far its author's best-known book. I have to say that it's not completely clear to me that the setting, a castle near the Carpathians, is actually in present-day Hungary, and I would be grateful for enlightenment on that point. For now, I'm running with it as the winner. It is:
Embers / A gyertyák csonkig égnek, by Sándor Márai
The GoodReads rankings are very different from LT's. Way at the top by ownership on GR, though only third on LT, and tagged "Hungary" second most often on LT and third most on GR, is a sweeping huge novel about the Holocaust, originally published in 2010. Again, I am a little uncertain about the setting - although a lot of it is clearly set in Budapest, there are also excursions to Paris and elsewhere, and I don't know to what extent the book can truly be described as set in Hungary. It is:
The Invisible Bridge, by Julie Orringer
Second by ownership on LT, and also on GR (once you have excluded some which are not set in Hungary) is a wonderful travel memoir of the 1930s. I fear it doesn't qualify because not enough of it is actually set in Hungary (its sequel, which is in fact set largely in Hungary, scores a bit lower), but for the record it is:
A Time of Gifts, by Patrick Leigh Fermor
Kate Seredy, who I had expected to do better, is some way down. Fatelessness by Nobel laureate Imre Kertész is mostly set in Auschwitz, which is not in Hungary.