Can I install sub floor over carpeting?
Pull out the carpets. never put a subfloor over something like old carpet. You may not have any moisture problems now, but any occurrence  of water (flood, broken plumbing, spill) getting in that hidden carpet in the future will cause you more grief than you could dream of. This would be a perfect situation to grow mold, mildew, stink and rot the wood subfloor from the bottom up. Don't take the chance, remove it before putting down anything else.