Different parts of a piano are made of different materials. For some parts, the type of wood used strongly affects the quality and musical character of the instrument. In today’s global economy, most manufacturers have access to and use materials that are appropriate for the level of quality and musical characteristics they are seeking.
Note that the outer veneer of a piano, such as mahogany or walnut, is decorative only and has no bearing whatsoever on the musical or structural quality of the instrument.
For a mildly technical, but easily readable, explanation of piano parts, quality, design, and materials, we suggest you read The Piano Book, by Larry Fine.