In the framework of monopoly and perfect competition, the good is "presumed" to be homogeneous for "SIMPLICITY".
Of course, a monopolist could produce heterogeneous good.
For example, a super-power software producer upgrades its softwares year by year.
Yet, this complicates the analysis.
In oliopoly, the good is "presumed" to be heterogeneous based on some characteristics like location and quality.
We do this to take into account the interactions among firms, where the game theory comes in !
Thus, it is just the intrinsic assumptions of these models that determine whether or not you should consider the choce of quality.
Hope it helps