It can be done, but you will have to know location of the rafter so that the hole that penetrates the roof and ceiling is not in conflict with one of the rafters. You may also choose to box in the opening between the roof and ceiling such is done for A/C and roof mounted fans. Be sure to select the sky light size, roof and ceiling pieces, prior to making any cuts. Locating the sky light in the flat part of the roof is advisable.