yes it is possible, but it is a bit a wild ralley of expressions in my brain;-). Also possible, that there is a more ellegant and easier solution with python...Let's say your layer A contains your ids which should be selected by the pairs of values (field "link" in brackets, [1,3]) in your layer B. The first step is to make virtual field, e.g. "sel" in layer B with the expression shown in the image below. This will dynamically reflect the selection state of your layer B, which we will need later in layer A:
The next step is to build the expression in layer A to select the features which are related to the selected features in B. There we will use the aggregate function which is very powerful:
replace(replace(replace("link", '[',''),']',''),' ',''),
concatenator:=', ') ) ,
to_string( "id" ))
The aggregate function collects all items from the link field, which are selected (filter:="sel"=1). then we have to replace the brackets [1, 2] and spaces with the 3 replace statements. it would be easier to get rid of them before. at the end we put the string back into an array and proof if the id from layer A will be within the array...