I heard that TeX is a Turing complete language. Does it mean that one can use TeX for example to write operating systems or games like Tetris or Hangman? I don't mean that one writes a source code of Tetris but I mean, can one play Tetris somehow by writing a document and compiling it?
“Turing-complete” means that, in theory, a TeX engine with enough memory could run a simulation of any of those things. It wouldn’t be practical.
The game of Tetris would not actually be playable, because TeX is not designed to read a controller and update pictures in real time, but it might come closest. However, you might write code (let’s say, in TikZ) that produce an animation of a Tetris game based on a given input file. It’s also possible to imagine making a simulation of the memory of some 8-bit computer, like an Apple II, including the CPU and the memory, as a state machine. You could then run a simulated operating system in the document and draw what would appear on the screen when the simulated program finished.
LuaTeX provides hooks to insert arbitrary Lua modules, but that’s somewhat different from doing it in TeX.