Regarding Leveling Up into a Lv. X from an EX or an ex, you cannot level up from either an EX or an ex, as the EX/ex is part of that card's full name, and the Lv. X says "Levels Up from Darkrai" or something to that effect, specifically referring to "Darkrai", not "Darkrai EX" or "Darkrai ex" (the latter of these not being a real card - ex cards were printed before Darkrai came into existence in the TCG).
And Devolution Punch works by requiring your opponent to take the highest stage of their Active Pokemon off of their Active Pokemon and put it back into their hand. For instance, if it were a Garchomp, the damage would be dealt to Garchomp, then they would have to return Garchomp to their hand, leaving them with a Gabite active. Calculations for the KO would then be done to the Gabite, which retains all damage and energy that were attached to or dealt to Garchomp. Your opponent could evolve it back into Garchomp on their turn if Gabite was not knocked out after the attack, though.
As for Devolution Punch against a Basic Pokemon like Mewtwo EX, Mewtwo EX would stay in play, as you cannot devolve a Basic Pokemon, though you would still deal the damage to Mewtwo EX, as the attack doesn't say that the devolution must be done in order to use the attack.