Let $(X, {\cal A}, \mu, \tau)$ be an ergodic dynamical system and $\varphi$ be a measurable map from $X$ to a locally compact group $G$. We consider the skew product $\tau_\varphi$ defined on $X \times G$ by $\tau_\varphi: (x,g) \rightarrow (\tau x, \varphi(x)g)$. When the system is an ergodic rotation and $G = \RR^d$, we give examples of functions $\varphi$ with bounded variation which are non-regular (i.e. such that the ergodic decomposition of $\mu \times dg$ for $\tau_\varphi$ is based on non-finite $\tau$-invariant measures on the base). We give as well examples for which, on the contrary, the measure $\mu \times dg$ is ergodic and one can identify all ergodic $\tau_\varphi$-invariant locally finite measures. The noncommutative case is also considered and the recurrence of a class of cocycles in the group of triangular matrices $N_3$ is shown.