Natural selection applies to anything and everything that meets three criteria:
1) Fitness is limiting and determines survival
2) There is variation in fitness
3) Variation is heritable
(You can add more criteria to be more precise, and I've seen it formulated as 2 criteria... but this is the basic idea)