Logic refers to the most basic set of logical operations, and the axioms which we can build on top of those fundamental operations. Mathematics builds on these fundamentals with non-logical axioms, postulates which are used as building blocks for a more complex system.
Euclidean geometry is a mathematical system which starts from a set of five basic postulates:
1. A straight line segment can be drawn joining any two points.
2. Any straight line segment can be extended indefinitely in a straight line.
3. Given any straight line segment, a circle can be drawn having the segment as radius and one endpoint as center.
4. All right angles are congruent.
5. Through any given point not on a line there passes exactly one line parallel to that line in the same plane.
These, with corresponding idealized definitions of 'point' and 'straight' and 'indefinite' and 'circle', rather than physical constructions, concretely define pi as a ratio between the circumference of the circle and the length of the line segment. Any universe where a mathematician can imagine these five postulates and use them to calculate pi will result in the same value.
If you discard or modify one of these postulates, you can come up with a system like a hyperbolic or elliptical geometry where pi could have a different value. Euclidean geometry closely corresponds to a our macroscopic physical world, one can form something fairly close with a straightedge and compass.
If you're imagining other universes, you might as well imagine one where the universe itself has a different geometry and the basic axioms are different. In that universe, children drawing a line in the dirt with their fingers would fundamentally understand that there are infinitely many lines parallel to the first in the same plane and would be taught so in primary school, but if they grew up to be a mathematician and replaced that postulate with ours, independently inventing Euclidean geometry, he could discover our definition of pi.
Conveniently, typical algebraic postulates like those resulting in Euler's formula, differential equations, integration, power series, and other mathematical constructs also result in the same definition of pi as that derived from Euclidean geometry. This seems to indicate to me that it's not just a constant in our preferred flavor of geometry but perhaps more fundamental.