Both work just fine. You can even use major credit cards.
Baja has been using dollars and pesos interchangeably ever since it received its first tourist a century and a half ago. Pretty much everyone accepts both, although out-of-the-way places, which keep very little money in the till, might make change in pesos. Even the symbol that both currencies use, $ (for solidus and shilling), is the same. To avoid confusion, the convention along the border is to use a distinctive suffix: “$25.00 m.n.” (moneda nacional) and “$2.00 dlls” (dollars).
The fun starts when you worry about the exchange rate. Every shop sets its own. Businesses that want dollars, such as supermarkets and Pemex stations, will offer a rate slightly better than the casas de cambio. Those that prefer pesos, usually the smaller operations, will offer a slightly lower rate. People who look to get the best price all around town will carry both currencies – but that certainly is not necessary.