If you are talking about silicone spray, sure, just don't rely on it as any kind of useful lubricant.
If you are actually talking about wd40 (the water repellent/ "lubricant" spray), don't get it in the bottom bracket bearings or on to the chain. Ideally, I wouldn't get it on any part of the chainrings that will make contact with the chain. It is a more of a solvent than a lubricant and will dissolve and remove your chain oil or your BB grease.