It is possible, but the stock pistons are sitting 0,15mm over the deck(they protude 0,15mm). The M47 crank, would make them protude 3,5mm more, so you would have to shave the piston at least 3,6mm.
Having the pistons flush with the block deck (0 deck height) would give you around 1929cc, and 11,7:1 CR, that´s a little too much for stock specs. To be on the safe side, I would go no higher than 11:1 CR. That would mean to have the pistons sitting below deck around 0,6mm. Having to shave a total of 4,15mm off the top of the piston. Now comes the problem with the first ring being too close to the piston deck if you shave that much.
I would go for different pistons or a shorter rod, the M40(Euro 318i) has 5mm shorter rod than the M42 (M40: 135mm rod / M42: 140mm rod) also the US M3 e36 S52 engine(321hp) has a 135mm rod and same bearing size.
I have the following combo: M47 crank, M42 E30 rods, M3 e36 (S52) pistons (86,4mm bore) and pistons are sitting 0,05mm below deck. Final displacement of 2040cc, 11,5:1 CR.
If you need any more advise just let me know. Also please keep in mind this numbers might be wrong, so double check to make sure.
I hope this helped!!