Depends on the pump. I once worked at a plant where a very important (but small, like a pool pump size) was found to have its outlet valve inadvertently closed. Since this particular pump only runs occasionallly, it was OK but the question was, would it have wrecked itself if it had had to run? A mockup was built with a spare pump to duplicate the configuration. It was instrumented with temperature probes etc, and then started with the discharge closed. The test commenced with numerous observers including some from an interested regulatory agency. The pump temperature rose over the first ten minutes and then leveled off, vibration was normal, etc. As the first hour went by, the crowd of onlookers dissipated exponentially. I think they ran it for 12 hours, no change.
So, depends on the pump. I wouldn't try it with a big expensive one. And the system design shouldn't rely on the pump "taking it."