Having a Duldung is not a requirement to get married. The Duldung is not relevant to the Standesamt but to the immigration authorities. It allows you to temporarily stay in Germany in order to get married.
You can apply for a Dulding from the Berlin immigration authority (LEA – Landesamt für Einwandrung). You should apply in writing and provide evidence of your upcoming marriage as the reason to be given a Duldung.
While generally the authorities provide a Duldung to cover the time until you are married, it is more complicated to get a residence permit once you are married. While you will be entitled to a residence permit as the spouse of a German citizen, you did not enter Germany with the correct visa. The authorities will most likely tell you to leave Germany and get a visa for family reunification at a German embassy abroad before returning. There are very few exceptions to this rule, largely based around having young children together.
Having A1 level of German is also a requirement to get a permit as the spouse of a German.