Please tell me, could seasonal or pet allergies affect mucus in the chest?

Yes. Asthma is a disease of the lungs that is often allergic, and this allergic inflammation can lead to mucus production. Exposure to allergens to which you're allergic will increase this. See an allergist to better understand what is happening to you.