Your MacBook comes with a lithium-ion battery. In fact, most, if not all, Apple products include lithium-ion batteries (though this wasn't always the case and may depend on the model and year of your Apple device). Lithium-ion batteries are overall well-performing, efficient, lightweight batteries, but they aren't perfect.
Like all technology, they have pros and cons. Lithium-ion batteries have a maximum cycle count (how many times you can charge and use your Mac before the battery needs to be replaced), which essentially means that, like all products and technology, lithium-ion batteries has a lifespan.
In addition to having a lifespan, lithium-ion batteries also have some sensitivity to extreme temperatures. Having your Apple devices, Mac included, in extreme heat or cold will deplete the battery. It isn't uncommon for people who live in naturally cold or hot environments to notice a decrease in battery performance.
If you live in areas such as Arizona, which are regularly extremely hot, avoid leaving your Apple devices in hot cars, homes that don't use air conditioning or have good airflow for extended periods of time, and anticipate possibly needing to charge your devices more often if they have been in extreme heat for long periods.
If you live in areas that are often extremely cold such as Alaska or Northern Canada, or areas that have rough, chilly winters, you may also notice that your batteries may have to be charged more often. Avoid leaving your devices in cold areas for extended periods, such as in a cold car, unheated room, etc.
So, yes. Extreme temperatures will make your Mac battery deplete faster, but it may depend on how extreme the temperatures are and what precautions you take.
To check the health of your battery, read through this guide!