Apple Silicon M1 uses ARM architecutre and exisitng ns3 docker images are not build for the architecure. You can build your own images.
First, you need to install Docker Desktop for Apple Silicon https://www.docker.com/get-started.
- Get this repository and build from terminal
docker build -t ns3-base .
- Run the container
docker run -itd --name ns3 ns3-base
- Run the simulation
docker exec -it ns3 ./waf --run scratch/scratch-simulator