Since the obvious answer is, Yes of course you can. There are many other factors to consider before deciding the real answer to this question for your environment. Your lifestyle as well as over all Look you need to achieve should be the first considerations; then are the stairs high traffic or rarely used; are is your home older? do you have kids?, etc. Type of pattern may not be as critical as the carpet itself there are also many factors, like the type  carpet fiber, density, carpet rating, twist rating.
In general, the best type of carpet for high traffic stairs is a low profile pile. Since low profile doesn’t tend to mat down easily and will show less wear overall. Carpets with patterns will also help to hide Traffic patterns and will not show as much wear on the nose of the step and in general patterns have more rows of stitches and these materials are typically very dense.
Knowing that one main characteristic to pattern carpet is dense allows these to be a good fit for steps. The denser the fiber the more likely it will keep its form and the less likely it will crush. Long pile carpet tends to end up seeing fibers crushed on the steps.  So the shorter and denser carpet will keep a fresher look over time.
The best type of fibers that are best for high traffic stairs are Wool, Nylon, and PTT Polyesters because they are strong, dense and clean well. Avoid fiber like Olefin because they don’t tend to hold up as well but not many pattern carpets come in Olefin.