Characterization of foreground emission on degree angular scales for CMB B-mode observations: Thermal dust and synchrotron signal from Planck and WMAP data