Hi, Chinese speaker (not native but pretty fluent) here :)
Taiwanese accents and "mainland" accents are very different. To the point where it can sometimes be quite hard to understand people who don't speak in a standard accent or the accent where I live in China (in my opinion).
The "mainland" accent you hear in mainland dramas is either standard or a bit northern. The standard accent isn't native to any particular place, but rather the most clear pronunciation of Mandarin Chinese. Northern accents tend to be close to the standard accents but have more "r" sounds (for example we say 'wa-r' instead of 'wan' for 玩 meaning 'play', or 'yi-dia-r' instead of 'yi-dian' for 一点 meaning 'a little bit'). There's a few other things that are pronounced differently and we have a few things we might call by other words, but that's the most noticeable difference. The common Taiwanese accent is different in the way that 1) they use different words sometimes. 2) Pronunciation is a bit different, they tend to pronounce SH more like S, CH more like C (ts), and ZH (like a j sound in the back of the mouth) more like Z. And 3) some tonal differences, in the mainland we have quite a few words that end with no tone (AKA the original character has a tone but we just don't really pronounce it when its part of some bigger words) but Taiwanese will fully pronounce all the tones.
There's TONS of mainland accents though. Basically every city or region has their own accent, or even dialect/language. Which leads into the next part: dialects. Most people consider Mandarin and Cantonese to be different languages, though I do see quite a bit of debate between whether its a dialect or language. Compared to other languages in China, though, Cantonese is a bit easier to understand. But if someone started speaking Cantonese to me, as a Mandarin (aka Standard Chinese) speaker, I would almost certainly have no idea what they are saying. When I read lyrics/subtitles when listening to Cantonese sometimes I think, "Oh, yeah, that sounds a bit similar to the Mandarin pronunciation", but that's about the best I can do.
Some other languages in China include Mongolian, Tibetan (with several of its own dialects like Amdo-Tibetan spoken in parts of Gansu), Miao/Hmong, Lahu, etc. and a lot of dialects in different cities. Most of the languages that are totally separate languages are from different ethnic groups. China has 56 ethnic groups, while the majority of the population is Han, there are over 100 million people who are ethnic minorities. But relatively speaking, since there are so few ethnic minorities, it's very rare to hear these languages on TV, and most people wouldn't understand.
Jumping back to Taiwan, not only does their standard accent sound different, but its also quite common to hear Hokkien added in. Most Taiwanese people can speak Hokkien (about 80%), which comes from Fujian province in mainland China, which is next to Taiwan. There are also some other languages which are a lot less common but still present, like Hakka and indigenous languages. While I think Mandarin is more common in Taiwanese dramas, I've noticed dramas like "The Victim's Game" and "A Boy Named Flora A" have quite a bit of Hokkien.
I'm not a local, so if any Chinese friends have anything to correct me on, please feel free~