We introduce an extension of Dual Dynamic Programming (DDP) to solve convex nonlinear dynamic programming equations. We call Inexact DDP (IDDP) this extension which applies to situations where some or all primal and dual subproblems to be solved along the iterations of the method are solved with a bounded error. We show that any accumulation point of the sequence of decisions is an approximate solution to the dynamic programming equations. When these errors tend to zero as the number of iterations goes to infinity, we show that IDDP solves the dynamic programming equations. We extend the analysis to stochastic convex nonlinear dynamic programming equations, introducing Inexact Stochastic Dual Dynamic Programming (ISDDP), an inexact variant of SDDP corresponding to the situation where some or all problems to be solved in the forward and backward passes of SDDP are solved approximately. We also show the almost sure convergence of ISDDP for vanishing errors.