Recall that mutation is a rare, random change in genetic material that can be inherited.
In every DNA there is a base sequence (A,C,T,G,A,A,C,C) which is what constitutes the gene. The form of the gene is called an allele. Certain processes can result in a change of the base sequence which is what we call a mutation. For instance, the base sequence of ACT into AAT. This creates a new version of the allele and it is possible that this process will result in an entirely different protein and therefore creating an entirely different phenotype. The reasons why dominant alleles and recessive alleles exist is because of this process.