Yes. You can accomplish your instrument experience in a flight simulator, flight training device or advanced training device (ATD).
An authorized instructor with FAA certificates and appropriate ratings must be present for you to log and count the instrument time for recency of experience purposes.
The only reason to accomplish instrument experience is to satisfy the recency of experience requirements in §61.57. This experience has to be logged according to §61.51.
There are two separate types of recency of experience listed in §61.57(c): maintaining instrument experience 61.57(c)(1), (2) and (3) and to regain instrument privileges after it has lapsed for more than six calendar months. §61.57(d) lists out what is required to regain instrument privileges.
§61.57(c) Instrument Experience
(1) Use of an airplane, powered-lift, helicopter, or airship for maintaining instrument experience
(2) Use of a flight simulator or flight training device for maintaining instrument experience.
(3) Use of an aviation training device for maintaining instrument experience.
(4) Combination of completing instrument experience in an aircraft and a flight simulator, flight training device, and aviation training device.
(5) Combination of completing instrument experience in a flight simulator or flight training device, and an aviation training device.
(6) Maintaining instrument recent experience in a glider.
Each of these has its own requirements to maintain instrument experience. If you are still current you are allowed to keep yourself current using one of the methods listed above.
§61.57(d) - Instrument Proficiency Check
A person who has failed to meet the instrument experience requirements of paragraph (c) for more than six calendar months may reestablish instrument currency only by completing an instrument proficiency check
(1) The instrument proficiency check must be—
(i) In an aircraft that is appropriate to the aircraft category;
(ii) For other than a glider, in a flight simulator or flight training device that is representative of the aircraft category; or
(iii) For a glider, in a single-engine airplane or a glider.
If a pilot lapses with their instrument currency for more than six calendar months, they must complete an IPC check. If they are in months 7-12 (or 3-8 for ATD in #3) they can complete the previous requirement laid in in §61.57(c).
The IPC must be completed in an aircraft, flight simulator or flight training device. An ATD is not allowable for an IPC check.
§61.51 Pilot Logbooks
(g) Logging instrument time.
(1) A person may log instrument time only for that flight time when the person operates the aircraft solely by reference to instruments under actual or simulated instrument flight conditions.
(2) An authorized instructor may log instrument time when conducting instrument flight instruction in actual instrument flight conditions.
(3) For the purposes of logging instrument time to meet the recent instrument experience requirements of §61.57(c) of this part, the following information must be recorded in the person's logbook—
(i) The location and type of each instrument approach accomplished; and
(ii) The name of the safety pilot, if required.
(4) A person can use time in a flight simulator, flight training device, or aviation training device for acquiring instrument aeronautical experience for a pilot certificate, rating, or instrument recency experience, provided an authorized instructor is present to observe that time and signs the person's logbook or training record to verify the time and the content of the training session.
Authorized instructor means—
(i) A person who holds a ground instructor certificate issued under part 61 of this chapter and is in compliance with §61.217, when conducting ground training in accordance with the privileges and limitations of his or her ground instructor certificate;
(ii) A person who holds a flight instructor certificate issued under part 61 of this chapter and is in compliance with §61.197, when conducting ground training or flight training in accordance with the privileges and limitations of his or her flight instructor certificate; or
(iii) A person authorized by the Administrator to provide ground training or flight training under part 61, 121, 135, or 142 of this chapter when conducting ground training or flight training in accordance with that authority.