Welcome to the MongoDB Community Forums @REGO350 !
I think that should be OK as long as brew --prefix reports /usr/local and the right substitutions were made in /usr/local/etc/mongod.conf.
Can you check the MongoDB logs for errors. Something like this should show you the last lines in the log:
tail $(brew --prefix)/var/log/mongodb/mongo.log
I have MongoDB 5.0 installed on an M1 via brew, but when I installed Homebrew it used the preferred default prefix of /opt/homebrew.
Regards,
Stennie