Topology is an essential part of creating 3D models. It is generally a rule of thumb that models should be created with all quads if the mesh is going to deform, such as with character meshes that will be animated. If a mesh is not going to deform, then it is reasonable for the mesh to contain some triangles and n-gons. Regardless of how the topology is formed, the game engine will convert the mesh to entirely triangles. However, to avoid irregularities or unexpected results, it is always a good idea to consistently use the same methods and clean topology. The Pushing Points Topology Workbook by William Vaughan is a great resource to learn how to correct common topology errors.

ArtStation - The Pushing Points Topology Workbook, William Vaughan

For more info on the application of topology in games (hard surface), watch the below video that covers ngons, triangles and quads.

https://youtu.be/sFSTfAOOZ9M