Yes, you can keep shrimp with pea puffers. Pea puffers, especially those bred and raised in captivity, are unlikely to attack or eat shrimp.
Generally, as long as the shrimp and pea puffers are similarly sized, the pea puffers won’t eat the shrimp. With that said, the pea puffers might still be tempted to eat baby or juvenile shrimp every now and then. However, they won’t affect the overall population of the shrimp.
Here are some types of shrimp you can keep with your pea puffers: