How to use get_theme_mod in gutenberg editor wordpress?

You don’t, if you need a dynamic value you have to have a server rendered block.

Otherwise, if you managed to get the theme mod, it would be frozen to the value it had at save, and changing the value in the customiser would not update the blocks. So use a dynamic server rendered block and grab the value in PHP the same way you normally would.

tech