Dominance is defined based on the phenotype
Dominance is defined based on a phenotype of interest. Pick a phenotype, say coat color for example. If genotypes
Aa have the same coat color while
aa has another coat color, then
A is domiant over
The concept hold even for sequence that do not produce proteins
The concept of dominance can be applied to any locus which variance explains phenotypic variance, whether this locus codes for a protein or not.
Most sequences that affect the phenotype are regulatory sequences that do no produce any protein. In such case, your intuition that dominance is the allele that produce more proteins really does not make much sense.
A whole lot of mechanism can yield to such dominance relationship. It is not uncommon that the recessive allele comes from a loss-of-function mutation. In such case, yes it is likely that the
AA genotype produce twice as many proteins as the
Aa genotypes. But this is definitely not the only possible mechanism. Note that whether the number of proteins produced of the
AA genotype is twice the number of protein produced of the
Aa genotype, won't change anything to the phenotype of interest by definition of what dominant mean.
Dominance is actually pretty unusual
Most phenotypic traits actually result from the influence of several loci and allelic relationship at these loci are rarely perfectly dominant. Perfect dominance exist in reality but is definitely over represented in intro classes as they are simple to understand study cases.
Note that there is a positive correlation between how recessive an allele is and how deleterious it is. It does not mean that the recessive allele is necessarily deleterious but there is a tendency.