I have read on a few websites that there can be competition between the viruses in a host for replication, nutrition etc. Do viruses fight against each other, i.e. are there viruses that infect or attack other viruses directly or indirectly?
If yes, can this property help in curing or limiting hazardous viruses such as HIV using less hazardous viruses which can be cured and can compete with these hazardous viruses?
From what I understand virus on virus action is not particularly common but it isn't unheard of.
Consider the Sputnik virophage which
reproduces in amoeba cells that are already infected by a certain helper virus; Sputnik uses the helper virus's machinery for reproduction and inhibits replication of the helper virus.
Also consider the Mavirus virophage, which
is a double stranded DNA virus that infects the marine phagotrophic flagellate Cafeteria roenbergensis in the presence of a second virus — Cafeteria roenbergensis virus. Mavirus can integrate into the genome of cells of C. roenbergensis, and thereby confer immunity to the population.
As a last example, consider the Organic Lake virophage, which
is a double stranded DNA virus that infects the marine phagotrophic flagellate Cafeteria roenbergensis in the presence of a second virus — Cafeteria roenbergensis virus. [...] [It] preys on Organic Lake phycodnaviruses, which in fact may rather belong to Mimiviridae than to Phycodnaviridae.
So yes, viruses do at least occasionally attack viruses and inhibit their infectious potential and grant a sort of immunity. I'm not aware of any applications of this in medicine for now but maybe somebody else can add something to this if they know.
As TG2 mentioned, some viruses may exploit the presence of an additional virus, but viruses generally don't infect other viruses (as in a smaller virus injecting its DNA into a larger virus) simply because they lack the built-in resources and protein-machinery to replicate other virus species.
Natural selection causes each virus strain to retain only the genes it needs to replicate itself, which means the chances of being able to replicate a rent virus inside a fundamentally different virus are effectively 0 for all practical purposes.
Additionally, there's no reason for viruses to infect other similar (by surface structure or content) viruses because in the case of an infection, the virus particles would quickly cannibalize each other, collectively thwarting themselves.