Molecular impurities interacting with a many-particle environment: from helium droplets to ultracold gases