All-optical implementation of collision-based evolutions of open quantum systems