One of the most annoying ways to end a climax where it looks like the villain's going to win is to have the hero on the ground and stunned or something, with the villain standing over him and about to chop his head off, and then have a friend show up out of nowhere and shoot the villain in the back, killing him. Is there any lamer way to make the goodguys win after you've written them into an impossible situation?
Now this doesn't mean your heroes can never be rescued, it just means there's a criterion: the rescue can't come out of nowhere. In volume 10 of Attack on Titan, the author had a group of characters cornered by monsters and then the main group of heroes show up and rescue them at the last second, but in the end of volume 9, the author had shown us the heroes deciding to go to where the other characters needed rescuing, and they had a reason to go there, so it didn't feel like a cop-out.
Another way this can be okay is if it's early in the story and the protagonist's life is at stake. In these situations the reader will be expecting a rescue out of nowhere, since they know the protagonist can't die that early in the story.