Translation:I took a day off from school yesterday.
I was wondering the same question. It seems that 休むcan be both transitive and intransitive (but with slightly different meanings). My source/more info here: https://japanese.stackexchange.com/questions/36189/why-absent-from-school-is-gakkou-wo-yasumu-when-yasumu-is-intransitive-verb
Yes, you can^
^It drastically changes the meaning of the sentence though, because で and を are different particles with different functions. を marks the direct object, so the thing that you "rested" was "school", i.e. you didn't go to school. On the other hand, で marks the location or means by which an action took place, so the place where you "rested" was "school", i.e. you had a rest at school.