Asterisk itself doesn’t care, however Docker itself brings with it different things you need to think about. For example: Networking. SIP places IP addresses and ports in the signaling, so that has to be configured and allowed through. As well how are you going to get configuration into it? A mapped volume? A bind mount?
There’s a lot of aspects you have to think about and experiment with which are not really Asterisk specific.