Starting from any two compactly supported refinable functions with dilation factor $d$, we show that it is always possible to construct $2d$ wavelet functions with compact support such that they generate a pair of dual wavelet frames in $L_2(\bR)$. Moreover, the number of vanishing moments of each of these wavelet frames is equal to the approximation order of the dual MRA; this is the highest possible. In particular, when we consider symmetric refinable functions, the constructed dual wavelets are also symmetric or antisymmetric. As a consequence, for any compactly supported refinable function $\phi$, it is possible to construct explicitly and easily wavelets that are finite linear combinations of translates $\phi(d\cdot-k)$, and that generate a wavelet frame with arbitrarily preassigned number of vanishing moments. We illustrate the general theory by examples of such pairs of dual wavelet frames derived from $B$-spline functions.