Purely rules-as-written, no, you can't do this; a Deva's polymorph doesn't give them the ability to change their type. A ranger gets a beast companion, not a celestial.
But assuming you want to hand-wave that and just say "a god did it, it's fine", then you're off in the weeds, and the answer to this is going to ultimately be that it's up to the DM. (I'm uncertain whether that's you or not.) For a thing like this, the player should work with the DM to figure out what's going on and how it operates, and as much as I hate to give this kind of answer, it doesn't matter unless it matters.
For example, I'm not sure why you chose a Deva in specific. Just because they have a polymorph power? It could just as easily be a "celestial spirit" in lizard form, which isn't explicitly an angel of any type -- the same kind of thing you could get from a Find Familiar spell could be in play here.
If the being is constrained to stay in beast-form at all times, and has the stats of a beast, then there's no real problem; it's just a companion animal like any other with a small twist. Having a different type than usual isn't a huge deal.
But is the expectation for the companion to have the stats of a Deva, with resistance to weapon damage and a three-digit HP total? Having a virtually invincible animal companion is obviously not balanced, so there's an issue there.
Is the player expecting that if the Ranger goes down and is about to die, his secret angel buddy is gonna suddenly pop their wings so they can save the Ranger with a healing touch, and maybe strike down upon the enemy with great vengeance and furious anger?
Because, I mean, the DM can do that if they want -- honestly that would probably make a pretty awesome pre-planned story beat when everything gets revealed, and then the angel buddy has to go back to the planes, because they broke the rules. But a cool story moment shouldn't have to be prefaced with months of gaming with a mechanically broken party member.
My recommendation is to forget the word 'deva' entirely for now, and have it just have the usual lizard stats in every way (except, possibly, the type). You'll need to have a plan for what's going to happen if the lizard drops to zero hit points or if it dies, and what it's going to do if the Ranger is in serious danger of death. If one of those plans says something like "the lizard turns into an angel", that's totally fine; don't feel like you need to mechanically justify how it was able to do that.