Hallo,
what conditions you must fulfil to enter Canada or UK for studying, you must take information from the relevant authorities in these countries. Check the Websites of their embassies, of the universities there, write to the universities, which are interesting for you. Take in mind that the education in these countries is mostly expensive and in Germany it costs almost nothing. Perhaps you will be able to have a stipendium.
As to Germany, as a person with any kind of residence permit (inclusive unlimited "Niederlassungserlaubnis") you can't leave the country for more that 180 days without losing your permit automatically. You must make an application in your Ausländerbehörde before 180 days expire (better to make it before you leave Germany), explain why you must stay longer and get an official permision, only then you will keep your status.