No. Oregon did not become U.S. territory through the Mexican–American War (1846–1848).
The Oregon Treaty of 1846 with Great Britain established the 49th parallel as the border, giving the U.S. the Oregon Territory (present-day Oregon, Washington, Idaho, parts of Montana, Wyoming).
The 1848 Treaty of Guadalupe Hidalgo ceded California, Nevada, Utah, Arizona, New Mexico, Texas, and parts of Colorado, Wyoming, Kansas, Oklahoma – but not Oregon.
Both treaties were negotiated simultaneously (Polk administration) but involved different countries and territories.