Dharmapala is basis of protection, Yidam is basis of enlightenment and Guru is basis of blessing. Guru is basis of blessing because of transformation of your body, speech and mind to 3 kaya of Buddha. Without Yidam, one cannot attain enlightenment. Although Yidam and Dharmapala are manifestation of Guru, but they have their specific purpose. Hence, Dharmapala cannot be treated as Yidam, because Dharmapala specific purpose is to protect Dharma and practitioners.