Is it a good practice to mark questions duplicate if you have seen a
similar question on some other websites?
This practice is impossible. The Stack Exchange system does not facilitate it.
A question cannot be closed as a duplicate of a question on another site. (Furthermore, there's no reasonable expectation that someone search the entire Stack Exchange network before posting a question on one site, though at least often it's reasonable to expect that someone will search the whole web with a general search engine like Google.)
Instead of closing as a duplicate of a question on another site, which cannot be done, when a question appears to be the same as a previously asked and answered question on another SE site, one of the following alternatives may be taken. The right one depends on the specific circumstances, as explained.
If the question is not really the same, but just somewhat related--as is often the case, especially across sites--then it can simply be answered. An answer may use and cite some information from one or more answer to the related question on the other SE site.
If the question is really the same and on-topic, it can simply be answered with a link and quoted, properly cited excerpt to the other answer. It sounds like that's what should happen here, and it has.
There is no problem with this situation. You may get different answers due to having asked a different community. We ask that people not ask the same question on multiple SE sites. We don't ask that people not ask a question one one SE site that someone else once asked on another SE site.
If the question is really the same and off-topic, and it's high quality, it can be migrated and closed as a duplicate, or just closed as off-topic.
If the question is really the same and off-topic, but is low quality, it should not be migrated; it should simply be closed as off-topic.
I see no reason this question should be closed or migrated. The question you asked is on topic for Security.SE. If you want it to be migrated, that might happen, but I recommend against this. It's probably a valuable question for Security.SE.
The comment there is misleading because SE doesn't support cross-site duplicates. However, its author's intention may simply have been to point out that the similar (or the same) question had been asked elsewhere, and point to that question with its answers. If someone--that commenter or anyone else--downvoted your question because it was asked on SO, that's silly, though perhaps they thought you should've researched better and discovered the SO question by better searching of the web.
I don't agree with that reasoning for downvoting your question, but there's nothing you can do about it. It also doesn't matter much--you don't lose much rep from downvotes, and you've gained more rep for that question than you've lost, anyway. And you shouldn't assume that's necessarily the reason someone downvoted.