Hello Mody,
Many times they are synonyms as previously mentioned, when they mean to tease, behave or speak deceptively for fun.
However sometimes 'to kid' means to delude or fool oneself into believing something and here the meaning differs from 'to joke' as in :
" Don't kid yourself into believing that."