In a non-Euclidean space with sufficient negative (hyperbolic) curvature it should indeed be possible to have a convex octagon with four 90° internal angles. Just like in a space with positive curvature, such as the surface of a sphere, it is possible for a triangle to have three 90° internal angles.