It is morally permitted to tell a lie in order to avoid torture?

It depends on the person and their point of view. I would not think it is right just something that has to be done.