Am I allowed to create audio files with apple TextToSpeech on my Mac and then use these recordings in my app or web page?
I assume this is a legal question and not a technical question. If you create sound files using some program, you hold copyright in that content to the extent that it is not an unpermitted derivative work (e.g. you can't feed a novel into a synthesis program and create an audio book). It doesn't matter which operating system or program you are using. There is the possibility that a certain software license prohibits commercial use, so that you could not use the software to create sound files that you sell, so you would also have to check your software license.
You need to look at licenses. Last time I looked (and I did look because I was interested in the subject), the voices that are included with MacOS and iOS came with a license that allows the owner of the device personal use. If you design things so that the user who listens to the text creates the sound using the voices on their device, you are fine. Creating the audio on your computer and distributing it wouldn't be allowed.
There are companies producing voices with licenses that allow you producing, recording and distributing audio using their voices.