Regarding the fast on the 27th of Rajab, there is no Sahih Hadith in any of the kitaabs of Hadith to support it. Therefore the fast of the 27th Rajab is not Sunnah and if kept with this belief will be incorrect. Yes, if someone keeps fast on the 27th of Rajab without having the belief that it is Sunnah, this will be acceptable.
Regarding the fast of the 15th of Shabaan, it is reported in Ibn Majah on the authority of Ali (ra) that the Holy Prophet Muhammad Sallallahu Alaihi Wasallam mentioned: “When the 15th night of Shabaan comes, on that night offer Nafal Salah and keep fast. Although this narration is weak and we cannot conclude that the fast on the 15th of Shabaan is Sunnah, however it can be kept as a measure of precaution and is also advisable due to the other narrations which emphasise the virtues of fasting in the first half of the month of Shabaan but not explicitly on the 15th. Also it is Sunnah to fast on the 13th, 14th and 15th of every month. It is for this reason that the pious observe this fast as an advisable act on the 15th of Shabaan.
Ameer, Darul Ihsan Islamic Services Centre