thank you for sharing your question with us in the community.
In regards of your question:
1. Italy: https://www.asylumineurope.org/reports/country/italy/asylum-procedure/general/short-overview-asylum-procedure
I couldnt find any specific information whether you can apply in transit for asylum. Only that you can express your wish to apply with the border police.
2. Germany: https://www.wefugees.de/101666/can-i-apply-asylum-in-transit-area-of-the-airport
The necessary facilities exist in the airports of Berlin (Schönefeld), Düsseldorf, Frankfurt/Main, Hamburg and Munich.
Most of the process in asylum claims at airports take place at the Roissy Charles de Gaulle (CDG) in Paris.
I hope this could assist you, in case you need more information please do not hesitate to reach out to us.