In general, most non-Buddhist religions meditate on the deity as being outside the physical body. In these cases the deity takes the form of a refuge, or of a protector or messenger. Thus do they meditate, and of course this is fine. In the Buddhist tradition however, the deity is not meditated on as being outside the physical body. One meditates on the deity as being one's own essence expressing itself through oneself arising as the deity. One therefore thinks, "I am the deity," and with this conviction one meditates.
Why is it justifiable to meditate in this manner? As previously seen, the five afflictions are actually self-expressions of the five kinds of primordial awareness; thus our own mind is in essence exactly the same as the mind of a Buddha. In the philosophical treatises this is sometimes referred to as "sugataharbha" or "buddha-nature".
Because all beings possess this innately pure buddha-nature, they are pure by nature and not at all impure.
Being pure by nature it is perfectly justified to meditate that you are the deity, because this is exactly how it is!
--from Everyday Consciousness and Primordial Awareness, by Khenchen Thrangu Rinpoche