The setting of A Doll's House is an upper-middle-class household in Norway in the second half of the nineteenth century during the Christmas season. Interestingly, the specifics of this could easily be altered, and the story and its message still left intact. Probably, it could take place with only minor adjustments anywhere in Europe or North America during the same period, or even later. Arthur Miller was able to transfer the action of Ibsen's Enemy of the People to the US with what I would consider relatively small changes. The same thing could possibly be done for A Doll's House.
But, that said, how does the general setting convey the "moral" of the story? First, it's a time and place in which women are beginning to gain rights they may not have had just a few decades earlier, but they were still in a subservient position where any independent action by them needed to be camouflaged or apologized for. In the play, Nora's friend Christine is a woman who has worked in business and is qualified for the position at Torvald's bank. Nora herself years earlier took the initiative to apply for a loan without her husband's knowledge. This is the double-edged sword in the plot. The need to forge her father's signature on the application ends up destroying her marriage. In an ideal situation in which women have full rights in a society, it's unlikely this "criminal" act on Nora's part would have been necessary.
But the dysfunctional marriage, though typical of its time and later, shows even more starkly the subordinate position into which women of the time were thrust. Torvald has treated Nora demeaningly through the whole play, but the stream of abuse he hurls at her when it becomes apparent that he is in danger is the worst part of it. Probably in our time, a marriage such as this would have ended long before. That the dynamic we see, however, is unfortunately not entirely a thing of the past is an indication of both the timelessness of Ibsen and the fact that society still has a distance to travel in order to eliminate gender inequality.