This story is usually hailed as a masterpiece of psychological and social realism; in its portrayal of the last few weeks of a dying man's life, it mercilessly exposes the uncaring attitude of those around him as well as his own sense of first horror, and finally acceptance of his own death. There isn't much that appears so very unrealistic here, but arguably Tolstoy does exaggerate some aspects to make his point.
Ivan Ilyich's social milieu is shown to be completely devoid of any human feeling; the only people he seems to feel any sort of connection to are his young son, who is just a child, and the peasant Gerasim who is of a quite different social class. It may be a little hard to believe that Ivan Ilyich, with such a large circle of acquaintances, did not make one real friend in all his life. Similarly, the portraits of the medical and legal profession suggest that there is not really a single good thing to be said about them. The doctor, in particular, is described in terms tending almost to the grotesque at times, as during his physical examination of Ivan Ilyich when he is said to perform 'various gymnastic movements over him'. Although on the face of it the narrative tone is detached and matter-of-fact, Tolstoy's critique of polite society cumulatively becomes overwhelming.
Ivan Ilyich's sudden change of attitude as death swiftly approaches, from a shrinking horror to enlightened acceptance, may also be stretching credibility a bit. Tolstoy does make it plain that this change of heart is in the nature of a religious revelation:
He sought his former accustomed fear of death and did not find it. 'Where is it? What death?' There was no fear because there was no death.
In place of death there was light.
'So that's what it is!' he suddenly exclaimed aloud. 'What joy!'
This is Ivan Ilyich's subjective experience as he dies, and we just have to take Tolstoy's word for it that he suddenly experiences this revelation at the moment of dying.
The picture of polite society, the legal and medical professions, then may take on somewhat exaggerated, and unrealistic elements, but this is because the whole aim of the story is precisely to highlight the monstrosities that Tolstoy saw lurking under a civilized veneer. Ivan Ilyich's sudden change of attitude to death may also seem unexpected, but it occurs because Tolstoy had a purpose to show that life and death have a higher meaning outside of everyday reality.
On a somewhat different note, it might also be observed that the medical diagnosis offered in Ivan Ilyich's case seems rather unrealistic. Ivan Ilyich has continual pain and discomfort in his left side (resulting from the injury which seems to lead to his terminal illness) and the doctors think the appendix might be involved. The appendix, however, is on the other side of the body. This might just be to highlight the general incompetence of the doctors, or maybe Tolstoy simply wasn't interested in the finer medical details as his main purpose was to depict Ivan Ilyich's decline and death rather than to examine the specific nature of his illness.