I recently learned that the rules of Tetris are surprisingly subtle. For example, depending on how piece rotation is implemented, it may or may not be possible to clear three lines with a T piece ("T-spin triple").
It's not so easy. You also need a small overhang above the hole, and make the rotation "kick" against the overhang to make the piece fit. I think in some implementations the rules for wall kicks actually allow you to climb up certain shaped walls, all the way back to the top of the screen.