Going all in preflop with anything isn't the best idea lol. Unless you are short on chips. Think of it this way. About 80% of the time your AA will win if you get into a heads up pot. If you go all in though everyone will fold and you will have just stolen a few blinds (or worse someone will call with a lower pair or suited connector and hit a set, flush, or straight - you're creating a high variance situation for yourself by going all in). But If you raise the standard amount or 3bet instead of all in, and one (or two) players call, you stand to win much more in the long run because of that 80%
equity I mentioned. The more people stay in the pot the worse your chances of winning with AA will be though. So it's about finding the right balance of not making everyone fold to your raise while also not letting too many players see the flop.