This is even easier at the intersection between two walls (keep pressing against the edge where the two walls meet and gliding along it). Depends on the angle, I think. But I've never actually managed to use it to escape the cube I'm in - the game always snaps me back. I think it's constantly checking the location of the ship's center (to determine if it's changed cubes) and if it has, but it shouldn't have been able to - if there's a wall or closed door - then it resolves a "proper" location inside the cube which causes the snapping back. It looks like it does this before checking any triggers on the wall, so you don't activate the exit or anything.
You can use this to get through spaces like these
. So make sure if you put something like this in a level, you actually block off the middle as well, even though the player couldn't "physically" fit through. I think stuff like that is pretty rare though so in practice it's not usually an issue.
There's a similar, but unrelated, bug where you can shoot through walls with the Fusion or quad laser - just by shooting while being up against the wall at certain angles, because those weapons' projectiles appear far enough away from your ship that they spawn in the cube behind the wall.