Dear @Elvistris,
Welcome to the Wefugees Community and thank you for your question.
Yes, even if your asylum case is still pending, you are able to declare your child's custody and recognize the paternity/fatherhood. This procedure is not connected to your residence status in Germany.
Did I understand your question correctly? Otherwise, please also don't hesitate to get back to us.
All the best,
Meike