If I go into the last mission with low chaos, is it possible to get the high chaos ending by killing a lot of guards? If not, how many missions back do I have to go to get a high chaos ending?
Yes, you can get high chaos within the level if you start with low chaos, but the ending will be corresponding to the chaos level you started the level with.
The last mission (The Light at the End) is shaped by your overall chaos in the game before you start this mission. If you have low chaos when you start this mission, you will get the low chaos ending no matter how many you kill. But you can still get the overall high chaos at the ending summary screen, but this has no practical effect in-game. The only thing that the overall chaos level on the ending screen counts for is the achievement for completing the game in high/low chaos.
If the low chaos version of the mission loads, the good ending will show, even if Corvo kills enough guards to achieve high chaos in the mission stats.
If you want the high chaos ending, you'll need to get high chaos before the last mission. That means you will need to get high chaos in the mission stats for The Loyalists (which is the previous mission).
I tested, and if you play flawlessly (never detected and not killing anyone) until The Loyalists, you can't get high chaos by killing everyone in this level, including civilians. Which means you'll have to go back another level and raise chaos there too. But if you haven't played flawlessly, you should in most cases be able to get high chaos in The Loyalists level.
To get the chaos ending, you need to kill minimum 50% of the seen population in dunwall. Which means you minimum need to get back the half of the game.
But I'm not quite sure if it also depends on some key events too.
Read it here
It has been reported that, for High Chaos to be achieved, Corvo must kill 20% of the human population per mission. If his total kills exceed 50% of the population seen in Dishonored, Dunwall is irrevocably thrown into chaos, and the High Chaos ending is depicted.