Both the epidermis and dermis contain immune cells. The epidermis houses epidermal dendritic cells (Langerhans cells), while the dermis contains macrophages, lymphocytes, and mast cells. These cells work together to defend against pathogens and maintain skin health.