From what I recall, MHC markers act as 'self' markers which the immune cells detect using specific receptors. However, foreign particles would not have these 'self' molecules as MHC protein molecules are determined by a person's genes, so they are unique to individuals. Because of this lack of 'self', immune cells would treat the foreign particle as non-self. Also, the foreign particle may possess surface antigens which can be detected by immune cells, again, by using specific receptors.
Viruses infect cells and in turn, the infected cell releases interferon - a chemical signalling molecule which causes nearby cells to become more resistant to viral infection. The infected cell also breaks down some of the viral particles and displays these antigen fragments on its MHC I marker, effectively flagging itself for destruction by immune cells. By killing the infected cell, either through apoptosis/lysing, the virus is destroyed as they are obligate intracellular parasites - that is, they can only survive inside of a host cell.
Just gonna jump in here. Unfortunately, what you've said isn't really correct.
There are a number of ways that cells can recognise non-self. Certain cells of the immune system express receptors that can bind molecular markers that are relatively common in pathogens but never appear in humans. For instance, these receptors might bind double-stranded RNA, which occurs in some viruses but certainly not in human cells.
B-cells express receptors that are able to bind free antigens. These are molecules that are part of or produced by pathogens that float around in tissue. B-cells can bind a whole host of these molecules. They do not, however, typically express receptors to self molecules (how this happens is well beyond the course but basically any B-cells that express receptors to self antigens are deleted).
T-cells, on the other hand, express receptors that can bind antigens (i.e. molecules from pathogens) that are presented on MHC markers. MHC class I markers present antigens (they just hold them) that originate from inside the cell. Therefore, if a cell is infected by a virus, molecules from the virus are expressed on the surface of the cell. T-cells will recognise these molecules as foreign and will respond accordingly. MHC class II molecules are expressed on a limited number of cells. These molecules present antigens that have come from the environment. T-cells can bind antigens presented on these MHC molecules if they are non-self.