You can use a variety of things to punch instead of a heavy bag, such as a punching dummy, speed bag, or even just a regular old boxing bag. Each has its own benefits and drawbacks, so it really depends on what you're looking for in a punching bag replacement.
Punching dummies are great for working on your accuracy and technique, as they often have very specific target areas. However, they can be quite expensive and may not offer the same level of resistance as a heavy bag.
Speed bags are ideal for developing speed and timing, but again, they may not be as durable or offer the same level of resistance as a heavy bag.
A regular old boxing bag is probably the most versatile option, as it can be filled with various materials to change the level of resistance. However, it's important to make sure that the material you choose is appropriate for the type of punching you'll be doing (e.g., hard punches will require a softer filling).