The answer is b) on. Generally, people say "This person came on foot". The other three options would have some alternative implications. Saying that Mary came by her foot implies that Mary simply moved near someone's foot. Saying that Mary came in her foot would imply that Mary physically entered into someone's foot. Saying that Mary came at her foot would once again imply that Mary simply approached someone's foot.
Preposition is a word that indicates a relationship between nouns, pronouns, or phrase and other elements, in a sentence. It often expresses location, time, direction, or relationship.
The other options carry different implications. "Mary came by her foot" suggests she moved near someone's foot. "Marry came in her foot" implies she physically entered someone's foot. "Mary came at her foot" suggests she approached someone's foot.