Yes. Ideally the inlet of a wye will be anywhere from right on top to 45 degrees to either side of the top. Given proper pitch, it can be rolled all the way down to 90 degrees from the top, but that is usually avoided.

quote; Ideally the inlet of a wye will be anywhere from right on top to 45 degrees to either side of the top.

There is absolutely NOTHING wrong with laying a "Y" on its side, therefore it can be rotated 180 degrees from one side to the other. HOWEVER, depending on which direction you will be going from the "Y" will determine what fittings to use because a 45 elbow will ONLY straighten it out parallel to the pipe if the "Y" is NOT on its side or perfectly vertical.

Thanks for the responses! So now that we've established that a Y can be rotated 180 degrees, what about a 45 coming off of it? If I want to roll a Y up to 45 degrees, then put a 45 off of it going off to the side (to attached to a horizontal drain which will empty into the main) can I do that or does the code say no? Or is it a bad practice? Please see attached picture for reference:

The dynamics mean that if you want to go 90 degrees to the side the "Y" MUST be on its side. IF you want to go parallel to the main line, but at a higher elevation, it MUST be on its back. Any other angle between parallel and 90 degrees requires that the Y and 45 be "rotated" at specific angles to make the turn. IF the Y is on a "true" 45, then a 60 degree bend, (and they do NOT come in street pattern), will make a "perfect" 90 degree angle from the main at the higher elevation.