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 :
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.