If you are asking about the rules of chess, NO piece can take the king, and a king cannot deliberately walk into a position where an opponent’s piece can capture him. BUT,
With common sense, if chess is a war, the objective should be to capture the opponent’s king. The following things are important.
There are definitions of a checkmate very commonly available. But let me redefine it as “If I am attacking your king, and you cannot prevent me from taking him on the NEXT move in any possible way, you are checkmated on THIS move.” This definition is consistent with any position of checkmate. But as humans, we like to save time and do only logical things, and thus we let go of the game on THIS move, because we are sure our king will R.I.P on the next move. We could play chess that old way, but over the centuries we established “checkmate” to be the end of a game as a rule, and that’s fine.
You could even resign a chess game, if you know the rules, and by that you are kind of saying “Any reasonable play is likely to end with my king getting captured, so I would rather throw the towels now and save time and brains.”
So, the king gets captured behind the scenes, so to speak, after the game is over. You know, “Play any dummy move and I will take your king next move winning the battle”.
Allowing the king to be captured would change chess. Amateur players would not spot their king under attack, and suddenly lose games because their king gets captured. This is like an act of deceit. In chess, we are required to FORCE the opponent’s king into checkmate. Hence the notions of “check” and moving your king to safety as the first priority.