It's up to the DM, but allowing it doesn't require ignoring the rules.
In a technical, purely RAW sense, creatures and objects (like cloaks) don't create areas of dim light or darkness. Lights throw a radius of light, and that light level exists everywhere in the radius.
But even without invoking the "rule of cool" or DM fiat, I think it's obvious that this isn't the intent. There isn't technically a rule anywhere that says that a heavily obscured area -- like, say, "dense foliage" -- blocks light in any way, or that objects that provide total cover throw a shadow. There isn't even a rule in the book that says that walls block light! Because there doesn't need to be. This is clearly one of those areas where the players and DM are just expected to understand how light works in the real world, and apply that understanding to the game. We're meant to just understand that the light from a torch doesn't go through walls to illuminate the corridor beyond, because that's not what light does.
The definition of "dim light" specifically calls out that it's also called "shadows", which is a clue to what kind of light you might expect to find when there's an ogre between you and the torch, or under a large cloak.
So yes, it's generally going to be up to the DM to allow or disallow this trick, but only in the sense of whether it's a reasonable thing to be able to do, not because cloaks don't throw a shadow.
If this were my game, I wouldn't have a problem with a player doing it. I'd count swirling the cloak to be your usual free item interaction, and of course the bonus action to actually teleport, but no cost beyond that. However, it is a move that requires a bit of subtlety and grace to pull off, so if you're under time pressure (such as in combat), I might call for a modest Acrobatics check (DC 15-ish) to make it all work. If you fail, you've taken off your cloak and thrown yourself on the floor to no benefit, and it'll cost half your movement to stand up (as usual) with a sheepish expression (no action).