An algebraic approach to discrete dilations. Application to discrete wavelet transforms