Yes, they can run backwards. But but it's not as easy for the crew to see where they're going and see the lineside signals especially if it's a large loco with a tender. Smaller locos like tank engines that don't have tenders were designed so the crew had decent visibility whichever way the loco was going.