Be careful when interpreting rules you find in dictionaries (or from the mouths of teachers).
In English, most adjectives can be places immediately in front of the noun they modify:
A large house.
A good book.
A red car.
However, with some adjectives this is not done, so the following is wrong:
*An afraid king.
This is what your dictionary tells you. It does not say that afraid can never appear before any noun in any situation! Any time you think you find such a broad, absolute rule, be very, very careful. It is probably an incorrect interpretation!
In your sentence, it is the king that is afraid, not the dream. To be more precise, the adjective afraid is part of an attributive phrase (afraid the dream should prove true), that modifies he (and he refers to the king).
It is interesting to note that afraid actually does appear before what it modifies in the sentence! The comma after true is necessary in this case, in order to separate afraid from he. This sentence would be considered wrong:
*Afraid he built a castle.
We do need the comma:
Afraid, he built a castle.