I recently attended a screening of “The Giver” in advance of the movie’s Aug. 15 release. The Hollywood version of the still-popular 1993 novel by Lois Lowry is compelling in its own right as it depicts the bleak reality of a society that sacrifices human individuality in the utopian pursuit of “Sameness.” Watching the cast that includes Jeff Bridges, Meryl Streep and Katie Holmes in this powerful, dystopian story, I kept thinking of a real-life tale populated with actors on the world stage: communist Poland in the 1980s, when men such as Pope John Paul II and Lech Walesa changed history.

I was in Poland one day during that period, listening to the striking members of the Solidarity labor union at the Lenin shipyard in Gdansk. Story after story detailed the Polish people’s plight under the military rule instituted after the first glimmers of a bid for freedom. State control trumped individual human rights.

Yet the Poles knew that they had a champion: Pope John Paul II. The Solidarity labor leader, Lech Walesa, spoke to me movingly about the courage John Paul showed in standing up to this tyranny. The pope’s visit to Poland in 1979, and another in 1983, had given millions of Poles solace and inspiration.

Recently, I saw Mr. Walesa again. We assessed Poland’s political landscape, then and now, but the focus was mostly on the heady days of the past. Mr. Walesa extolled the Cold War leadership of Ronald Reagan and Margaret Thatcher, but he still holds a special place in his heart for John Paul.

Mr. Walesa, now a former president of Poland, reminded me that millions of Poles had been filled with hope from the first day of John Paul’s papacy, when Karol Wojtyla was installed at the Vatican and gave his first address in St. Peter’s Square, saying three times: “Be not afraid,” echoing the words of Jesus. Poles knew then that they were not alone as they kept their faith alive while living under a system that officially banned religion.

As the lights came up after the screening of “The Giver,” my thoughts were on Poland and communism, but soon they turned to the broader subject of totalitarian regimes robbing individuals of their God-given rights. So often, one of the first jobs of the totalitarian is to declare that God is dead and that government is the final authority on truth and justice—we see it now in North Korea. Such was the case when I visited Poland in the 1980s. Everyone in Poland worked for the state. The dignity of human life and the uniqueness of the individual were irrelevant. There was only Sameness.

In communist regimes, poverty is equally distributed—except for those in power. “The Giver” presents a clever twist on this totalitarian theme. In the fictional tale, every material need is met. We are in a world where all human misery has been eliminated. There is no rage, no war, no wealth and no poverty.

But at a cost. There is also no music, no art, no literature, no beauty. And no memory: Just to be safe, all memories are the possession of a lone individual. In this setting the human spirit is almost extinguished, and yet—well, you’ll have to see the movie. But I was reminded that the Poles, with their unconquerable religious faith, proved to be more powerful than a fearsome military power.

I saw the movie with John Sununu, the former New Hampshire governor and chief of staff for President George H.W. Bush. John too had been prompted to think of communist totalitarianism and the resilience of faith.

He recalled visiting Russia during the Cold War with a former high-ranking Soviet official, who suggested taking a short non-state-sponsored trip. They got into a car and soon the driver pulled up to an old, neglected-looking Russian Orthodox church. John’s host led him to the side door, took out a key and unlocked it. They went inside, and John was amazed to see that the church’s interior had retained its beauty and elegance.

The exterior had been allowed to fall into decline on purpose, his host explained, to avoid arousing government suspicion: Even though the state did not approve, he said, many of the congregants had never stopped quietly meeting there, to hold services and to pray.

Mr. Flynn is a former U.S. ambassador to the Vatican, mayor of Boston and the author of “John Paul II: A Personal Portrait of the Pope and the Man” (St. Martin’s , 2001).