Blocked hair follicles can come from lots of things. It can come from folliculitis, which is a simple infection of the hair follicle. This cane be cleared up with antibiotics.
An oily scalp will block the pores in it- the hair follicles. Not washing the hair clean after dyeing cause blocked follicles, similarly hair product residues like hair gel.