Can apt-get in Dockerfile be executed correctly in other systems?

  docker, question

When I was looking at the relevant Dockerfile documents, I saw

RUN apt-get install -y ca-certificates nginx && \

This kind of command, but apt-get seems to be a command of debain system, can it be run under other linux or windows?
Or, my operating system is centos7, can I replace it with yum install?

There are fromfromBasic imageimage, has nothing to do with your host environment