Dear @ibrahimss,
Your question can be better answered by Italian authorities or organisation working with migrants in Italy. Here is an overview of some organsations in Italy which may be able to help you:
https://w2eu.info/en/countries/italy/contacts
If your visa for Germany expires in Italy before you marry there, I imagine you may be issued with a temporary certificate of sort to allow you to stay until marriage. Alternatively, the Italian authortiies could ask you to leave Italy and apply for the appropriate visa before returning. For this reason it would be best to apply for a visa for marriage at the Italian embassy in Germany while your visa in Germany is still valid.
Here's more information about visas for Italy:
https://vistoperitalia.esteri.it/home/en
Best,
Éanna