Sure. Not only is it possible, the first design for a Turing-complete computer was purely mechanical. This was Charles Babbage's Analytical Engine. Babbage published its design in 1837, long before electricity was considered a practical source of energy, and even longer before electronics was even imagined.
The Analytical Engine was inspired by looms. Already in the 18th century there were looms that could be controlled by a punched tape which described the pattern to weave. Babbage had first designed a mechanical calculator, the Difference Engine, where a tape described mathematical operations. The Difference Engine could only perform prearranged calculations: it didn't have the ability to run arbitrary loops. The Analytical Engine could control the direction in which it processed its control tape, and since it also had conditional execution capabilities, it could perform arbitrary loops. The Engine had an internal memory where it could store data, which made it practically Turing-complete in the sense that an arbitrary program can be run on an engine given enough memory (which is the sense in which modern computers are Turing-complete). Everything was based on moving parts (wheels, pistons, etc.), and a complete description of the state of the engine would be a description of the position and orientation of these moving parts.
The Analytical Engine was never built. It was too complex and would have been too expensive and too slow to be worth the while. It didn't even have any direct influence on the design of the first electromechanical computers in the 1930s and 1940s, because their designers were not aware of the Analytical Engine. But it had indirect influence, partly through the work of Ada Lovelace. If Babbage was the first computer hardware designer, Lovelace was the first computer programmer. She realised that the Analytical Engine could not only make numerical calculations, but more generally could process data. Lovelace's contribution also fell into obscurity, but Babbage and Lovelace's work fostered an interest into the mathematics of computation.
Beyond looms, which translated instructions into cloth patterns, there were other mechanical engines existed with no or limited power to make numerical calculations before the first electronic computers. In particular, Herman Hollerith's mechanical tabulating machine could sort data and count records matching certain conditions; it was first used to process census data.
The progress of electronics, was what made general-purpose computers practical by the 1930s to 1940s. But the fundamental ideas of machine computation had been around for about a century. Electronics aren't the only way to design a computer, they're just (so far) the only economically viable way.