A person who thinks they are always right and dismisses any other opinion as wrong is often referred to as "dogmaticor have a "closed mind" attitude.