Yes, it is safe for guinea pigs to eat apricots but there are a few things to remember before you feed apricots or any other fruits for that matter to your guinea pig.
The main thing is moderation as most fruits contain a lot of sugar and too much sugar is bad for a guinea pigs diet.
It can cause obesity, diabetes, digestive issues and other health related issues. Therefore fruits such as apricots should only be given as a treat and only rarely. Possibly as a training tool once in awhile.
Make sure that you thoroughly wash the apricots first and remove the stem and pit in the middle before giving to your guinea pig. Also it would be a good idea to cut them into smaller pieces to avoid the fruit becoming a choking hazard.
The main source of their diet should include high quality timothy hay, fresh water and Vitamin C fortified pellets. Remember this is their main diet and should be given to them everyday in order for them to have a happy and healthy life.