Accurate reference tracking is essential in control tasks in a variety of applications, and, in repetitive systems, model-based Iterative Learning Control (ILC) is a standard solution that is underpinned by formal stability and convergence guarantees. To overcome the limitations of model-based ILC design, data-driven ILC methods have been introduced which lead to a patchwork of several, very different approaches that do not preserve the modularity and theoretical guarantees of the many, well-established model-based ILC methods. We, for the first time, propose a unifying framework for data-driven ILC that preserves the modularity and formally proven properties of model-based ILC. Specifically, we propose Iterative Model Learning (IML) and Dual Iterative Learning Control (DILC). The IML framework enables iterative learning of unknown dynamics in repetitive systems using input/output trajectory pairs. We formally prove the duality between IML and ILC, i.e., an IML system is equivalent to an ILC system with a trial-varying reference and trial-varying but known dynamics. We further provide generic conditions to guarantee the convergence of the model and prove the duality of monotonic convergence in ILC and IML. This duality allows arbitrary, established, model-based ILC methods to be effectively applied within the IML framework to learn models of unknown dynamics. Unlike existing data-driven ILC approaches which only combine specific model learning schemes with specific model-based ILC approaches, the proposed DILC framework combines IML with model-based ILC such that established, model-based ILC methods can be arbitrarily combined for simultaneous model and control learning with a formally proven separation principle. The proposed DILC is a unified framework for data-driven ILC that not only relieves model-based ILC of a priori model requirement but also preserves the modularity and theoretical guarantees of model-based ILC. Both IML and DILC are validated by extensive simulations and real-world experiments.