Sumsung's S-Pen implementation does not support global palm rejection at the OS level, so it is up to each and every app to do so. Some apps support it, such as AutoDesk Scetchbook. It would be very useful to have similar support in TeamViewer app for Android.
As a note, this feature might be applicable to other stylus pen input implementations, but my issue is specific to Samsung Galaxy Tab S4. As far as I know this issue is common to all Galaxy Tab and Galaxy Note implementations as of the time of writing. See here: