The dealer thought it was a misdeal, took a players cards and mucked them. Another player still with cards had someone not playing ask the player what their 2 cards were and to dig them out of the mucked cards and resume play. Is this legal?
No, not really. I would describe it more as a moot point. The player that is asking for the cards to be dug out of the muck, does not really have a right to ask to see the hand, nor is there any good reason to see the hand, the player is really just wasting everyone's time and being a bit of a schmuck. The player should just ask the guy what he had, if he gets an answer that is fine.
This should never become a point of dispute. Once the dealer has announced a misdeal, it is a misdeal, regardless of whether that announcement was made correctly (for example, believing more than one card had been exposed during the deal, when only one had been exposed).
This is in addition to the general rule that mucked cards are never pulled out, with the exception of a supervisor or floor manager or other controller investigating hands which had been exposed prior to mucking, to determine the correct winning hand.
Both rules exist precisely to prevent these shenanigans. Poker is a game of imperfect information and decisions must be made based on the information available at the time of the decision. A player deciding to throw away their hand cannot change their mind, and misdeals are enforced to prevent players who have acted on that decision from being blocked out of a hand. In both cases, decisions cannot be changed based on later information.