If it gets sucked up by the filter it dies but if you can keep it separate from the filter, it will be fine.
You can put Duckweed in a breeding net in the tank and the net will stop the plant being sucked into the filter. You can also make a loop/ ring out of plastic airline or plastic hose/ poly pipe. The loop is tied to a piece of string about 10 inches long and the other end of the string is attached to a suction cup that gets stuck to the side of the tank.
The plant is put in the loop and this stops it spreading around the tank.
The string allows the loop to go up and down during water changes and stops the loop from being sucked towards the filter.