AK is known among poker players as Anna Kournikova, looks good but doesn't win! This is an easy way to play a hand in non-stacked games. However, there are several factors to keep in mind:
Much depends on your opponents. Are your opponents loose or tight? What are their preflop calling, raising and reraising ranges? This is important because if they are tight you will not go all-in preflop. There will be little point in this action. But if they call all-in with K7s or 75o, you can play for the stack.
Position at the table matters a lot. Positional players usually open fewer hands in early position than in late position. Thus, if there is a raise from early position followed by a reraise and then another reraise, then AK should probably fold. But if the raise comes from the button and the small blind calls and you are in the big blind with AK, then this is a completely different situation. In this case, AK is probably the best hand.
Think about the future. This point differs from the previous two regarding opponents and position. This is because the first two points tell you a lot more about what a particular action means. Raising, re-raising, and re-raising in action does not necessarily mean AK is not the best hand in the game. It doesn't matter if there is active action preflop or not. What matters is who raises and from what position. Some people's raising and reraising ranges are very different from others, and you should pay attention to that.
The depth of the stack matters. The fewer the blinds in the stack when all-in, the less significant your mistake will be. If you face aces or king. Playing 40 BB is much easier than playing 500 BB, right? And honestly, if you have 500 BB in front of you, you should never go all-in with AK.