Idioms use language metaphorically rather than literally. 'She put her foot in her mouth' means that she said something stupid and was embarrassed by it (the metaphorical meaning) not that she ate her toes (the literal meaning).
Idioms are also fixed groups of words so you can't change the wording of an idiom. For example, you can say 'They get on like a house on fire' to describe how much two people like each other but you can't say 'They get on like a hospital on fire'.