The information you have given suggests that you are getting thoughts which are inappropriate and disturbing your routine life.
This types of thoughts are seen in people with obsessive compulsion disorder. Instead of knowing inappropriate one can not control the thoughts.
I suggest you to consult the psychiatrist
to assess you completely and to advice treatment.
Thank you for your query on Healthcare Magic.
Hope I have answered your query.