Within the framework of Hinduism, Shiva is one of the gods of the Trimurti ('three-forms', the Hindu Trinity), in which he represents the role of the god who destroys the universe, along with Brahmá (the god who creates the universe) and Vishnú. Within Shivaism he is considered the supreme god.
This as other deities from other cultures may seem strange at first glance, as other cultures find strange our crucified Christ on the cross; but in general without knowing much about their culture we tend to have an attraction to some at first sight.
The figure of Ganesha is an archetype loaded with multiple meanings and symbolisms that express a state of perfection as well as the means to obtain it. Ganesha is in fact the symbol of the one who has discovered the divinity within himself.
Shiva is the god of destruction, who puts an end to what exists so that what is new can emerge and life can be transformed and renewed. For this reason, it is more accurate to define him as the god who regenerates the universe.