Primary immunodeficiencies (PIDs) are disorders of the immune system that involve faulty cellular, humoral, or both cellular and humoral functions. PIDs are present at the crossroad between infections, immune dysregulation, and cancers. A panel encompassing 42 genes involved in both PIDs and cancer has been investigated for the genes’ compositional properties, codon usage patterns, various forces affecting codon choice, protein properties, and gene expression profiles. In the present study, the codon choice of genes was found to be dependent upon the richness of the nucleotide; the viz AT nucleotide rich genome preferred AT ending codons. The dinucleotide TpA adversely affected protein expression, while CpG did not. The CTG codon was the most overrepresented codon in 80.95% of genes. Analysis of various protein properties, including GRAVY, AROMA, isoelectric point, aliphatic index, hydrophobicity, instability index, and numbers of acidic, basic, and neutral amino acid residues revealed that the hydrophobicity index, instability index, and numbers of acidic and basic amino acid residues are the factors affecting gene expression. Based on neutrality analysis, parity analysis, ENc-GC3 analysis, and regression analysis of nucleotides present at the first and third positions of the codon, it was determined that selection pressure, mutation pressure, and compositional constraints all participated in shaping codon usage. The study will help determine the various evolutionary forces acting on genes common to both PIDs and cancer. Codon usage analysis might be helpful in the future to augment both diseases simultaneously. The research also indicates a peculiar pattern adapted by a set of genes involved in any disease.