Flashing your brake lights is not a good idea to deter tailgaters. This may provoke a road rage.
To deal with tailgaters, it is not a good idea to flash the brake lights. This could provoke unnecessary accidents and making the situation worse.
So, how to deter tailgaters?
You can do few things to deter tailgaters. You should proceed at a safe pace. Don't over speed and avoid reckless driving. You can allow more following distance from the vehicle in front of you.
Here is a guide: How to deal with tailgaters without losing your rag?