Several telecommunication providers / mobile operators decided to hand out sim cards for free to refugees from Ukraine 😀.
Additionally, phone calls to Ukraine as well as text messages are free of charge.
Also, some refugee centres are offering Wi-Fi for free. Generally, you are able to find free Wi-Fi spots in Germany using Apps like https://www.wifimap.io/
The journalists of WDR have set up a special page on communication too (in UKR): https://www1.wdr.de/nachrichten/fluechtlinge/ukraine-kostenlos-telefonieren-internet-102.html