recording and multi recording

is it possible to record with audacity while using a sampler on the same PC in the same time im playing ?

Make the sampler play to a sound file. Open the sound file in Audacity and play it at the same time you’re recording a fresh performance. That’s overdubbing.

Fair warning you have to listen to your microphone, mixer, or interface to hear yourself at the same time as the backing track. (Substitute your high quality headphones).

Screen Shot 2021-12-20 at 1.38.50 PM.png
If you try to do it by listening to the computer, your live performance is going to come back to you late or with an echo.