You can flip the memory foam mattress over like you did the old mattresses but it's not recommended to flip a memory foam mattress since it's made of specific layers that shouldn't be flipped over.
Flipping the memory foam mattress over can mess with the layers of the mattress and make it less comfortable.
However like I said if you want to rotate and flip the mattress over then you can although it may affect the warranty on the memory foam mattress.
Another option is to just rotate the mattress 180 degrees every 3 months which can help even out the wear on the mattress.