The term dinner comes from French, which (as everybody knows) is a Romance language. And in Romance languages meals were not associated with parts of the day. In Latin for example eating was called either a "general meal" = prandere (a "fast" or a "snack" in English) or a "main meal" = disjunare (a "dinner"). In fact, one could even call their breakfast a "dinner", if that's their main meal. The association of meals with parts of the day comes from the Abrahamic religions and is a rather new concept for Indo-Europeans, which explains misconceptions like the above.
Med, as far as I can think of, only means "with". There may some some very exceptional cases where prepositional misalignment between languages causes a usage of med to correspond in English to a use of "in", but in no way is med systematically a translation of "in". Rather, i and på mean in, in different scenarios.