The model is usually linear so 0,1,2 is the number of minor alleles in the genome (so 0=homo-major, 1=hetero, 2=homo-minor) and the assumption is that two minor alleles will have two times the effect of the major. It doesn't have to hold for every test and tool but this is what I've seen. If there are alternative minor alleles they could be two different SNPs or assumed to have the same effect (or avoided altogether).
One way of dealing with epistasis could be to multiply the two SNPs values and divide by 2 (to be in the 0-2 range). I don't know a tool that can do this but statistically is should be valid (assuming linear interaction and additive effect).