The Old Man and the Sea is set in Cuba in the middle of the twentieth century. The setting is a small village. There are several reasons why setting is important.
First, the narrative depends on the old man living in extreme poverty without a social safety net. If the story were set in a village in the Canadian maritime provinces in the present, the old man would have access to first rate free medical care, disability insurance, and welfare payments so that he would not be in danger of starving when injured or unlucky.
Next, the issue of luck and superstitions about it would not be of such importance in a more developed part of the world with a more educated populace. Also, in a more developed country, the boy would be in school and have many job options; apprenticeship would be less crucial.
The sort of ethos of machismo is also a part of Cuban culture that might not be found to as great a degree in Scandanavia or other countries where Hemingway could have set the story.
The small village in which people know and support one another also creates a different background to the story than would a big city.