You can as long as window is flashed to the insul boards. Usually flashing is done to the install flanges over house wrap. Insul boards can't be used as a drainage plane because of the joints. People use tape but I disagree there since tape can fail. Your window pan will have to sit over the insul board. I just read that asphalt based adhesive tapes may not be compatible with some plastics. Butyl tapes are but costly. I would: use asphalt based ice dam shield - knowing I wouldn't mix incompatible materials. First put the insul boards and cut the opening along the rough opening. Then house wrap. Then shingles along the window sill frame for slope and use asphalt adhesive ice shield to make the fan and flash to the window and the house wrap.
If vinyl side, come back to ask about how to install j channels for least leaking. With vinyl, there is no not leaking.