Your question is answered in great detail here by u/Domini_canes:
The thread shared from an earlier question answers a lot on the German context. I'll do my best to share what I know on Italy and rise of fascism.
At the beginning of his professional and political career, Benito Mussolini was a staunch critic of the Church. To say he was skeptical of religion would be putting it mildly. Mussolini, always wanting to be the center of attention, would put his radical ideas in writing or he would yell them aloud so that many could hear what he had to say. His thoughts on Christianity as a whole were one of these bold proclamations. David Kertzer outlines a few of these takes, saying:
In Lausanne in 1904, Mussolini agreed to debate a local Protestant pastor on the existence of God. After trying to impress his audience with citations ranging from Galileo to Robespierre, he climbed onto a table, took out a pocket watch, and bellowed that if there really was a God, He should strike him dead in the next five minutes. Benito’s first publication, titled “God Does Not Exist,” came the same year. He kept up his attacks on the Church, branding priests “black microbes, as disastrous to humanity as tuberculosis microbes” [Kertzer 21].
The extent to which Mussolini believed all that he was saying is contestable. Oftentimes, his provocative statements could be seen as attempts to grab attention and headlines. But he was certainly willing to go on the record as an opponent of the Catholic Church.
This switch flipped when he became Prime Minister. He decided to embrace Catholicism as a part of his identity. In his first speech to parliament, he invoked God, asking the Almighty for help and strength. Pope Pius XI and the Church from here seemingly ignored his past writings and tacitly consented to Mussolini and his Fascist party. There were dissenters among the rank and file members of the Church. “None was more embarrassed than Father Enrico Rosa, editor of La Civiltà Cattolica, who up to the time Mussolini came to power had used the journal’s pages to denounce Fascism as one of the Church’s worst enemies” (Kertzer 48).
In the end, it was likely not the best strategy for the Catholic Church to put their stock in someone who thought all Catholic holidays fell on Sunday. But he listened to the Church and looked to position himself as their partner. From Kertzer again:
Mussolini also took his first steps against Protestant organizations, which he knew would please the pope: he denied Methodists permission to construct a big church in Rome and rejected the YMCA’s proposals to build centers in Italy. Catholic seminarians were exempted from the draft... [and] he dramatically increased the government’s payments to Italy’s bishops and priests. [Kerzer 65]
The negotiations leading up to the Lateran Treaties show some of the tensions though. The Lateran Treaties were the negotiations and eventual agreement between the Catholic Church and the Italian government to form Vatican City. When they were overtaken by the Italian state, it created what became known as the Roman Question. Popes did not recognize the legitimacy of an Italian state, and questions of allegiance for the citizens of Rome persisted.
Evidence of this includes how Mussolini was able to use the autonomy of Catholic Youth Action to his political advantage. While the Vatican and Italy were projecting to the public a sense of partnership, this was not entirely the case. The underlying struggle between the centralized Italian state and Rome also persisted. Both were competing for hearts, minds, and loyalty. According to Albert O’Brien, Mussolini's aim was to form a new generation of Italians. He wanted the youth of Italy’s first loyalty to be to his regime and the Italian state while the Church would serve its interest.
Pope Pius XI fought back by insisting on the autonomy of Catholic Action, as he fought for the Church to be the youth of Italy’s first loyalty. Violence between Catholic and fascist groups broke out. On October 31, 1926 there was an attempt to assassinate Mussolini. In response, his Fascist followers directed violence against Catholic institutions. Targeted violence continued for months. And just as hostilities were dying down, the Fascist government decided to crackdown again on Catholic youth organizations in December. Because these youth groups were so important to the Church, Mussolini would use them in the negotiating process. “Mussolini used the threat to the independence of Catholic youth organizations as a source of tension forcing the Vatican and a reluctant pope into negotiating a concordat that would protect their independence” (O’Brien 129). With the power of the state to use police and force, Mussolini would use this leverage and ability to crack down at any moment he wanted when discussing treaties, including the Lateran Treaties. Pius XI played by these rules due to his desire for a state.
Sources:
Kertzer, David I. The Pope and Mussolini: the Secret History of Pius XI and the Rise of Fascism in Europe. Random House Trade Paperbacks, 2014
O'Brien, Albert C. “Italian Youth in Conflict: Catholic Action and Fascist Italy, 1929-1931.” The Catholic Historical Review, vol. 68, no. 4, 1982
While my writeup will not be nearly as in-depth as the one written by /u/Domini_canes provided in the thread earlier, I would like to highlight the work within Germany (and also, the criticism thereof) of the actions of Bishop Clemens August Graf von Galen of Münster.
The key points of interest with von Galen's resistance are the points at which he resisted Naziism within Germany, and the points at which he did not. Von Galen was appointed to the position of Bishop on the 5th of September 1933, holding the position until his death on March 22, 1946. I'm not going to go incredibly in detail on the specifics of his resistance, although the sources I will provide at the end do include plenty of detail for further reading.
The most famous example of this is the encyclical Mit brennender Sorge (With Burning Concern), which denounced the racial politics and euthanasia practices carried out by the Nazis within Germany. Noticeably absent from this encyclical, however, was any mention of the treatment of Jewish people.^(1)
The most direct action that Von Galen took was a series of three sermons delivered in the summer of 1941 that harshly attacked the Nazi government over its policy of euthanasia for the disabled. While his appeal to his listener's Catholic faith called for them to decry the actions of the Nazi government, he never once called for his listeners, nor Catholics as a whole, to engage in active resistance of the Nazis.^(2)
Von Galen took a public stand in a manner that not many that held power throughout the Nazi reign in Germany could. However, his resistance must be taken with a grain of salt, as while he voiced opposition through his Catholic faith, he did not call for the removal of the Nazi government, nor did he call for anything other than passive opposition of policies that were being carried out. I would, too, make the argument that leaving out the treatment of the Jewish population from his resistance was aiding the Nazis.
In the end, though, your question asked whether the Catholic Church spoke out against the fascist government in Germany, and Bishop von Galen did exactly that, even though he made no attempt to help Jewish people during the holocaust.
sources:
GRIECH-POLELLE, BETH A. "The Construction of an Image: Von Galen in Retrospect." In Bishop Von Galen: German Catholicism and National Socialism, 136-64. New Haven; London: Yale University Press, 2002. Accessed June 9, 2021. http://www.jstor.org/stable/j.ctt1npw9r.10.
(English language, is a great summary of the life of Bishop von Galen, and a solid critique of his actions during his time as Bishop of Münster)
Benz, Wolfgang. "Widerstand Von Christen: Anpassung Und Kollaboration Der Kirchen." In Im Widerstand: Größe Und Scheitern Der Opposition Gegen Hitler, 156-213. München: Verlag C.H.Beck, 2019. Accessed June 9, 2021. http://www.jstor.org/stable/j.ctv1168p2q.9.
(German Language, and covers Christian resistance much more broadly, such as the protestant theologians Karl Barth and Dietrich Bonhoeffer)