Can we do farm backup(from Central Admin) of sharepoint 2013 in Windows server 2008 R2 and restore the entire farm to Windows server 2012 R2?
Yes , it is possible , but it is not recommend to do it if this is production environment .
See the best practices when you want to do backup and restore :
I would never backup and restore the farm. Best practice is to 1. Build new farm. 2. Install all wsps you use in source (if you don't have them in source control you can backup them from the source farm) 3. Migrate content databases and services databases (if required) to the new farm.
Unless there is another reason beyond upgrading the OS, I would just add the 2012 R2 servers to your farm, transition services over to those servers, then remove the 2008 R2 servers from the farm.
On the SQL side, you can either add the databases to a SQL Mirroring session and failover to a new edition of OS + SQL, or simply use a SQL alias on the SharePoint servers (new and old) to point to the new SQL server.