I setup my Mikrotik router as cpe on wlan interface(192.168.40.2) connect to dlink router (192.168.40.1).
pc-a connects to mikrotik router ( 192.168.50.2)
pc-b connects to dlink router (192.168.40.3)
how could I forward the port on Mikrotik to be able to share samba between pc-a and pc-b ?
You can not, because smb can not work across subnets, broadcasts not being routed.
The only workaround is to set up a wins server on one of the networks, and make both PCs to use it.
Or reorganize the network so there is only one bridged network, with all smb clients in the same network.