I would say folding (and shoving) is generally much better than flatting given that it usually plays terribly in 4bet pots without initiative even if you are in position.
"If you miss you can just fold" is an attitude you really can't have in 4bet pots when you pretty much only have 1 potsize bet behind. If you're folding that spot ~67% of times where you miss the flop (actually you will miss flop even more than this since your opponents are very often holding an A or K (or two) themselves) you're bleeding money in this spot, hugely -EV to play fit or fold here.
Basically if your opponents 4bet range is wide enough to ship AK profitably then you ship it 5bet every time. If its not wide enough you need to ask yourself why you 3bet AK in the first place because its too good to turn into a bluff. If they're flatting 3bets a lot but narrow 4bet range then yes you still can 3bet for value but depending on their 4bet range, determine if shipping over is +EV or not.
If opponent is unknown generally I will be happy to get it all in with AK and reevaluate once I know more, depending on positions of course. Position is very important since UTG vs MP 4bet is completely different to BTN vs BB 4bet.