Can we use O2 to identify NO and SO2 from each other?

Is it because NO+O2-->NO2; NO2 - brownish gas
and

2SO2+O2--2SO3;SO3-blue in colour?

Or what is the reason?

You are asking, "Can we use O2 to ....". The odor of NO2 (and the brownish color) will identify NO2. Is SO3 bluish colored? I wasn't aware of that but it could be true and it certainly isn't brownish; however, the odor of SO3 is distinctly different than that of NO2. Having said all of this I would look at other methods of distinguishing them. The odor of NO and SO2 is distinctly different. Why go through the oxidation with O2. A quick smell and you will know what is the container.

Actually the question is about identifying each other with O2

Then I think you answer is ok except that I would use odor to identify SO3 as a back up to the color.

Yes, you can use O2 to identify NO and SO2 from each other based on their reactions. The reactions you mentioned are correct.

When NO reacts with O2, it forms NO2. The resulting NO2 gas has a brownish color. This color change can be used to identify the presence of NO.

The reaction is as follows:
NO + O2 → NO2

Similarly, when SO2 reacts with O2, it forms SO3. The resulting SO3 gas has a blue color. This color change can be used to identify the presence of SO2.

The reaction is as follows:
2SO2 + O2 → 2SO3

Therefore, by observing the change in color of the gases after reacting with O2, you can distinguish between NO and SO2. NO2 will appear brownish, while SO3 will appear blue.