Yes you can, but I suggest you soak them a little while in warm water first and add them and their water to the rice water. If you prefer to fry your spices first (Bargar) then do so and add them and the oil. Becareful with the quantities though, as the cooking process can make the flavours quite intense. As always experiment and trust in your trip.
Another tip if you pressure cook; watch out for the amount of salt you use, you probbably should use none or at least half your usual quantity. Oh, and if you are making Saffron rice or just using a colouring agent then make sure you mix with a little warm water and soak for a while and then add this to the rice water; just make sure you keep to the original volume of fluid.
CP