H/T to Ploni for finding this source (page 42(49)), which summarizes the Shemiras Shabbos Kehilchasa. In SS"K 27:4, which I just looked up, it states that an animal may do any Issurim that if a Jew would do them, would only be Issurei Derabanan, with some small exceptions related to carrying people/objects.
The footnote there says outright in the name of RSZ Auerbach that this includes even a Melacha Sheina Tzericha Legufah. While I'm not going to get into the nitty gritty of electricity on Shabbos, turning off a light falls into this category (since you are extinguishing in order to turn off/get rid of the light), while turning on a light does not. Therefore, it would be permitted to train one's dog to turn off the light on Shabbos.
Whether or not lights in general or the particular light fall under the category of Rabbinic Prohibitions is another question, but if they do, it would even be permitted to teach one's dog to turn on a light on Shabbos.