Geometric Flows and Perelman's Thermodynamics for Black Ellipsoids in $R^2$ and Einstein Gravity Theories