We already are accounting for the repeated alphabet. That $26^3$ comes from answering three questions: What is the first letter? What is the second letter? What is the third letter?
Those three questions are allowed to have the same answers, as in your example "aab". That's $26$ possibilities for each question, and each answer is fully independent of the others.
Arranging the letters of a fixed word "deed"? We can ask which letter goes in each place, but those choices are tied together by the need to use each of that original word's letters. The numerator $4\cdot 3\cdot 2\cdot 1$ comes from our choices being reduced at every step to whatever we haven't used yet, and the denominator $2\times 2$ comes from letters of the same type being indistinguishable; $d_1e_1e_2d_2$ and $d_2e_1e_2d_1$ are the same words.