Brandenburg was a principality of the Holy Roman Empire. Why was it allowed to chase for power independently and to acquire land outside of the Empire's territory and outside the authority of the emperor?
A simple answer is because It would go against he wildly accepted accepted inheritance laws at the time.
A more complicated answer: One mistake that many people make is thinking that the HRE was some kind of monolithic empire in the sense of the absolute monarchs of the French kingdoms. When in actuality they ruled as a sort of first among equals with them having to balance the various electors, cities and institutions of the empire against each other. In no way would it pay to antagonize a margravite (the rulers were margrave of Brandenburg) and set a precedent
that would prevent them from leagally acquired through marriage or election of their own territories outside the empire that they had previously gained such as the kingdom of Croatia in 1518